Skip to content

Commit ea75675

Browse files
committed
[v7] Remove forget async util
1 parent e6ec8d5 commit ea75675

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ClientLike } from '@sentry/types';
2-
import { forget, logger } from '@sentry/utils';
2+
import { logger } from '@sentry/utils';
33

44
const DEFAULT_SHUTDOWN_TIMEOUT = 2000;
55

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

1414
const timeout = client.options.shutdownTimeout ?? DEFAULT_SHUTDOWN_TIMEOUT;
15-
forget(
16-
client.close(timeout).then((result: boolean) => {
15+
client
16+
.close(timeout)
17+
.then((result: boolean) => {
1718
if (!result) {
1819
logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');
1920
}
2021
global.process.exit(1);
21-
}),
22-
);
22+
})
23+
.then(null, e => {
24+
// eslint-disable-next-line no-console
25+
console.error(e);
26+
});
2327
};
2428
}

packages/utils/src/async.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/utils/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from './async';
21
export * from './browser';
32
export * from './error';
43
export * from './instrument';

0 commit comments

Comments
 (0)