From 3dad683cb934e444ef60c51e419ef22f857228fa Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Tue, 29 Nov 2022 15:43:44 +0000 Subject: [PATCH] Adding back prod check. --- packages/worker/src/index.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/worker/src/index.ts b/packages/worker/src/index.ts index 50fb2fcb8d..34e6937f3a 100644 --- a/packages/worker/src/index.ts +++ b/packages/worker/src/index.ts @@ -46,18 +46,18 @@ app.use(auth.passport.session()) app.use(api.routes()) // sentry -//if (env.isProd()) { -Sentry.init() +if (env.isProd()) { + Sentry.init() -app.on("error", (err, ctx) => { - Sentry.withScope(function (scope: Scope) { - scope.addEventProcessor(function (event: Event) { - return Sentry.Handlers.parseRequest(event, ctx.request) + app.on("error", (err, ctx) => { + Sentry.withScope(function (scope: Scope) { + scope.addEventProcessor(function (event: Event) { + return Sentry.Handlers.parseRequest(event, ctx.request) + }) + Sentry.captureException(err) }) - Sentry.captureException(err) }) -}) -//} +} const server = http.createServer(app.callback()) destroyable(server)