Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/w/8.6/improvement/CLDSRV-544-std…
Browse files Browse the repository at this point in the history
…err' into w/8.7/improvement/CLDSRV-544-stderr
  • Loading branch information
BourgoisMickael committed Jul 3, 2024
2 parents 92f4794 + 0e39aaa commit fce76f0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'; // eslint-disable-line strict

/**
* Catch uncaught exceptions and add timestamp to aid debugging
*/
process.on('uncaughtException', err => {
process.stderr.write(`${new Date().toISOString()}: Uncaught exception: \n${err.stack}`);
});
require('werelogs').stderrUtils.catchAndTimestampStderr(
undefined,
// Do not exit as workers have their own listener that will exit
// But primary don't have another listener
require('cluster').isPrimary ? 1 : null,
);

require('./lib/server.js')();
1 change: 1 addition & 0 deletions lib/utapi/utapi.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('werelogs').stderrUtils.catchAndTimestampStderr();
const _config = require('../Config').config;
const { utapiVersion, UtapiServer: utapiServer } = require('utapi');

Expand Down
1 change: 1 addition & 0 deletions lib/utapi/utapiReindex.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('werelogs').stderrUtils.catchAndTimestampStderr();
const UtapiReindex = require('utapi').UtapiReindex;
const { config } = require('../Config');

Expand Down
1 change: 1 addition & 0 deletions lib/utapi/utapiReplay.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('werelogs').stderrUtils.catchAndTimestampStderr();
const UtapiReplay = require('utapi').UtapiReplay;
const _config = require('../Config').config;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"utf8": "~2.1.1",
"uuid": "^8.3.2",
"vaultclient": "scality/vaultclient#8.3.11",
"werelogs": "scality/werelogs#8.1.4",
"werelogs": "scality/werelogs#8.1.5",
"ws": "^5.1.0",
"xml2js": "~0.4.16"
},
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5986,6 +5986,13 @@ werelogs@scality/werelogs#8.1.4:
fast-safe-stringify "^2.1.1"
safe-json-stringify "^1.2.0"

werelogs@scality/werelogs#8.1.5:
version "8.1.5"
resolved "https://codeload.github.com/scality/werelogs/tar.gz/4131abec824a336eeb68b531e6c91f2748a0644a"
dependencies:
fast-safe-stringify "^2.1.1"
safe-json-stringify "^1.2.0"

whatwg-mimetype@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
Expand Down

0 comments on commit fce76f0

Please sign in to comment.