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
{{ message }}
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
There's no way to know if is safe to kill the process or if raven is sending data.
Scenario
Imagine that somewere in the code I want to kill my server, but in the meanwhile raven is sending some data to Sentry.
Workaround
let exceptions = 0;
process.on('uncaughtException', () => {
exceptions++;
});
raven
.config(dns, opts)
.install(handler); // Since we have passed a custom handler the process does not exit automatically, this is good :)
function handler(err) {
exceptions--;
// Log the erro on the console
console.log(err);
}
function close(cb) {
const interval = setInterval(closed, 100);
closed();
function closed() {
if (exceptions === 0) {
clearInterval(interval);
cb();
}
}
});
}
// Somewhere else
close(() => {
// This is called after all errors are been sent to sentry. Now you can kill the process safetly.
process.exit(1);
});
The text was updated successfully, but these errors were encountered:
Problem
There's no way to know if is safe to kill the process or if raven is sending data.
Scenario
Imagine that somewere in the code I want to kill my server, but in the meanwhile raven is sending some data to Sentry.
Workaround
The text was updated successfully, but these errors were encountered: