Skip to content

Commit fadc347

Browse files
author
Luca Forstner
committed
moar comment
1 parent 1296252 commit fadc347

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/node/src/sdk/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export class NodeClient extends ServerRuntimeClient<NodeClientOptions> {
3737
// There is one mild concern here, being that if users periodically and unboundedly create new clients, we will
3838
// create more and more intervals, which may leak memory. In these situations, users are required to
3939
// call `client.close()` in order to dispose of the client resource.
40+
// Users are already confronted with the same reality with the SessionFlusher at the time of writing this so the
41+
// working theory is that this should be fine.
42+
// Note: We have experimented with using `FinalizationRegisty` to clear the interval when the client is garbage
43+
// collected, but it did not work, because the cleanup function never got called.
4044
this._clientReportInterval = setInterval(() => {
4145
DEBUG_BUILD && logger.log('Flushing client reports based on interval.');
4246
this._flushOutcomes();

0 commit comments

Comments
 (0)