File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ if (!config.SENTRY_DSN) {
2020 throw new Error ( 'SENTRY_DSN was not set in config.json' ) ;
2121}
2222
23- Sentry . init ( { dsn : config . SENTRY_DSN } ) ;
23+ Sentry . init ( { dsn : config . SENTRY_DSN , tracesSampleRate : 1 } ) ;
2424
2525const storage = new Storage ( {
2626 projectId : config . PROJECT
@@ -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 ) ) ;
You can’t perform that action at this time.
0 commit comments