Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/production' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
daneryl committed Jul 16, 2024
2 parents 4261528 + 0f96181 commit abc0aa8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const http = Server(app);

const uncaughtError = error => {
handleError(error, { uncaught: true });
throw error;
process.exit(1);
};

process.on('unhandledRejection', uncaughtError);
Expand Down
9 changes: 9 additions & 0 deletions app/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { syncWorker } from 'api/sync/syncWorker';
import { InformationExtraction } from 'api/services/informationextraction/InformationExtraction';
import { setupWorkerSockets } from 'api/socketio/setupSockets';
import { ConvertToPdfWorker } from 'api/services/convertToPDF/ConvertToPdfWorker';
import { handleError } from './api/utils/handleError.js';

let dbAuth = {};

Expand All @@ -23,6 +24,14 @@ if (process.env.DBUSER) {
};
}

const uncaughtError = (error: Error) => {
handleError(error, { uncaught: true });
process.exit(1);
};

process.on('unhandledRejection', uncaughtError);
process.on('uncaughtException', uncaughtError);

DB.connect(config.DBHOST, dbAuth)
.then(async () => {
await tenants.setupTenants();
Expand Down

0 comments on commit abc0aa8

Please sign in to comment.