You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using application insights through npm in a web application and also running the project in nodejs for jest tests.
However, because AppInsightsCore.pollInternalLogs creates a setInterval which handle is never stored and there is no way to dispose of it, jest never manages to shut down properly.
Would you mind properly storing the returned handle from the setInterval and provide some kind of dispose function to stop this polling?
Alternatively, could it be possible to add an option by eg. setting diagnosticLogInterval to 0 to completely disable this polling?
From my tests I noticed that this internal queue never seems to be used anyway and always stays empty.
EDIT: For now I managed to disable this feature by executing this code before AI initialization:
constai=newApplicationInsights({config: {/* ... */}});// Disable pollInternalLogs to prevent jest from properly shutting downai.pollInternalLogs=()=>undefined;ai.loadAppInsights();
The text was updated successfully, but these errors were encountered:
Setting the interval to 0 might not solve the problem. setInterval actually has a minimum amount which is implicit, and depends on the browser. I believe it is around 10ms. We can just return without creating a setInterval when diagnosticLogInterval is set to 0.
I am using application insights through npm in a web application and also running the project in nodejs for jest tests.
However, because
AppInsightsCore.pollInternalLogs
creates asetInterval
which handle is never stored and there is no way to dispose of it, jest never manages to shut down properly.Would you mind properly storing the returned handle from the
setInterval
and provide some kind ofdispose
function to stop this polling?Alternatively, could it be possible to add an option by eg. setting
diagnosticLogInterval
to0
to completely disable this polling?From my tests I noticed that this internal queue never seems to be used anyway and always stays empty.
EDIT: For now I managed to disable this feature by executing this code before AI initialization:
The text was updated successfully, but these errors were encountered: