Skip to content

Commit cd8b566

Browse files
authored
Clear internal timer when manually flushing agent exporter (#5937)
1 parent f802fcd commit cd8b566

File tree

1 file changed

+3
-3
lines changed
  • packages/dd-trace/src/exporters/agent

1 file changed

+3
-3
lines changed

packages/dd-trace/src/exporters/agent/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ class AgentExporter {
3131
})
3232

3333
process.once('beforeExit', () => {
34-
clearTimeout(this.#timer)
35-
this.#timer = undefined
36-
this._writer.flush()
34+
this.flush()
3735
})
3836
}
3937

@@ -63,6 +61,8 @@ class AgentExporter {
6361
}
6462

6563
flush (done = () => {}) {
64+
clearTimeout(this.#timer)
65+
this.#timer = undefined
6666
this._writer.flush(done)
6767
}
6868
}

0 commit comments

Comments
 (0)