Skip to content

Commit 46a8c79

Browse files
committed
feat(sdk): await flush
1 parent 0f32d35 commit 46a8c79

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ export function validateGeneratedFile(req: Request, res: Response) {
6363
contentType: 'text/plain; charset=utf-8'
6464
}
6565
});
66-
stream.on('error', err => {
66+
stream.on('error', async err => {
6767
res.status(500).send(err.message);
6868
Sentry.captureException(err);
6969
if (transaction) transaction.finish();
70+
await Sentry.flush(5000);
7071
});
71-
stream.on('finish', () => {
72+
stream.on('finish', async () => {
7273
res.status(200).send(encodeURIComponent(objectName));
7374
if (transaction) transaction.finish();
75+
await Sentry.flush(5000);
7476
});
7577

7678
stream.end(JSON.stringify(report));

0 commit comments

Comments
 (0)