File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,14 @@ class HTTPTracker extends Tracker {
8181 this . destroyed = true
8282 clearInterval ( this . interval )
8383
84+ let timeout
85+
8486 // If there are no pending requests, destroy immediately.
8587 if ( this . cleanupFns . length === 0 ) return destroyCleanup ( )
8688
8789 // Otherwise, wait a short time for pending requests to complete, then force
8890 // destroy them.
89- let timeout = setTimeout ( destroyCleanup , common . DESTROY_TIMEOUT )
91+ timeout = setTimeout ( destroyCleanup , common . DESTROY_TIMEOUT )
9092
9193 // But, if all pending requests complete before the timeout fires, do cleanup
9294 // right away.
Original file line number Diff line number Diff line change @@ -41,12 +41,14 @@ class UDPTracker extends Tracker {
4141 this . destroyed = true
4242 clearInterval ( this . interval )
4343
44+ let timeout
45+
4446 // If there are no pending requests, destroy immediately.
4547 if ( this . cleanupFns . length === 0 ) return destroyCleanup ( )
4648
4749 // Otherwise, wait a short time for pending requests to complete, then force
4850 // destroy them.
49- let timeout = setTimeout ( destroyCleanup , common . DESTROY_TIMEOUT )
51+ timeout = setTimeout ( destroyCleanup , common . DESTROY_TIMEOUT )
5052
5153 // But, if all pending requests complete before the timeout fires, do cleanup
5254 // right away.
Original file line number Diff line number Diff line change @@ -129,12 +129,14 @@ class WebSocketTracker extends Tracker {
129129 socket . on ( 'error' , noop ) // ignore all future errors
130130 socket . once ( 'close' , cb )
131131
132+ let timeout
133+
132134 // If there is no data response expected, destroy immediately.
133135 if ( ! this . expectingResponse ) return destroyCleanup ( )
134136
135137 // Otherwise, wait a short time for potential responses to come in from the
136138 // server, then force close the socket.
137- let timeout = setTimeout ( destroyCleanup , common . DESTROY_TIMEOUT )
139+ timeout = setTimeout ( destroyCleanup , common . DESTROY_TIMEOUT )
138140
139141 // But, if a response comes from the server before the timeout fires, do cleanup
140142 // right away.
You can’t perform that action at this time.
0 commit comments