Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parthverma1 committed Aug 15, 2024
1 parent d8d52e6 commit 3c87c5e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion request.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ Request.prototype.getNewAgent = function ({agentIdleTimeout}) {
let agent = self.pool[poolKey]

// generate a new agent for this setting if none yet exists
if (!agent || (typeof agentIdleTimeout === 'number' && (agent.lastUsedAt ?? 0) + agentIdleTimeout < Date.now())) {
if (!agent || (typeof agentIdleTimeout === 'number' && (agent.lastUsedAt || 0) + agentIdleTimeout < Date.now())) {
agent = self.pool[poolKey] = new Agent(options)
// properly set maxSockets on new agents
if (self.pool.maxSockets) {
Expand Down
1 change: 0 additions & 1 deletion tests/test-agentIdleTimeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var server = require('./server')
var request = require('../index')
var tape = require('tape')
const { response } = require('har-validator')

var s

Expand Down

0 comments on commit 3c87c5e

Please sign in to comment.