fix: Load sentry for task runner server only if configured (no-changelog) (#11420)

This commit is contained in:
Tomi Turtiainen 2024-10-25 17:52:39 +03:00 committed by GitHub
parent 7699240073
commit d6aaeea2ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,12 +125,14 @@ export class TaskRunnerServer {
const { app } = this; const { app } = this;
// Augment errors sent to Sentry // Augment errors sent to Sentry
if (this.globalConfig.sentry.backendDsn) {
const { const {
Handlers: { requestHandler, errorHandler }, Handlers: { requestHandler, errorHandler },
} = await import('@sentry/node'); } = await import('@sentry/node');
app.use(requestHandler()); app.use(requestHandler());
app.use(errorHandler()); app.use(errorHandler());
} }
}
private setupCommonMiddlewares() { private setupCommonMiddlewares() {
// Compress the response data // Compress the response data