From e3ab8247761b0a61f25e08a1b8fd6b200a4be200 Mon Sep 17 00:00:00 2001 From: Daniel Bankhead Date: Sat, 3 Jun 2023 08:36:07 -0700 Subject: [PATCH] fix: keepAlive sample (#1561) * fix: keep alive sample The property should be `agent` * chore: copyright header --- samples/keepalive.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/samples/keepalive.js b/samples/keepalive.js index 9102be2f..2cab0e19 100644 --- a/samples/keepalive.js +++ b/samples/keepalive.js @@ -1,4 +1,4 @@ -// Copyright 2017, Google, Inc. +// Copyright 2023 Google LLC // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -41,17 +41,11 @@ async function main() { const agent = new https.Agent({keepAlive: true}); // use the agent as an Axios config param to make the request - const res = await client.request({ - url, - httpsAgent: agent, - }); + const res = await client.request({url, agent}); console.log(res.data); // Re-use the same agent to make the next request over the same connection - const res2 = await client.request({ - url, - httpsAgent: agent, - }); + const res2 = await client.request({url, agent}); console.log(res2.data); }