Skip to content

Commit

Permalink
[v7] Remove forget async util
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Mar 24, 2021
1 parent e6ec8d5 commit ea75675
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
14 changes: 9 additions & 5 deletions packages/integration-node-globalhandlers/src/exit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientLike } from '@sentry/types';
import { forget, logger } from '@sentry/utils';
import { logger } from '@sentry/utils';

const DEFAULT_SHUTDOWN_TIMEOUT = 2000;

Expand All @@ -12,13 +12,17 @@ export function logAndExitProcess(client: ClientLike): (error: { stack?: string
console.error(error && error.stack ? error.stack : error);

const timeout = client.options.shutdownTimeout ?? DEFAULT_SHUTDOWN_TIMEOUT;
forget(
client.close(timeout).then((result: boolean) => {
client
.close(timeout)
.then((result: boolean) => {
if (!result) {
logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');
}
global.process.exit(1);
}),
);
})
.then(null, e => {
// eslint-disable-next-line no-console
console.error(e);
});
};
}
12 changes: 0 additions & 12 deletions packages/utils/src/async.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './async';
export * from './browser';
export * from './error';
export * from './instrument';
Expand Down

0 comments on commit ea75675

Please sign in to comment.