dcp-worker 4.4.3 → 4.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,11 +19,12 @@ const path = require('path');
19
19
 
20
20
  const { logLevels } = require('../lib/consts');
21
21
 
22
- async function processExit(code)
22
+ async function processExit(code, silent=true)
23
23
  {
24
24
  if (typeof code === 'undefined')
25
25
  code = process.exitCode;
26
- console.debug('Exit, code', code);
26
+ if (!silent)
27
+ console.debug('Exit, code', code);
27
28
  await loggers.unhook();
28
29
  process.exit(code);
29
30
  }
@@ -35,7 +36,7 @@ function panic(...argv)
35
36
  processExit(1);
36
37
  }
37
38
 
38
- function main()
39
+ async function main()
39
40
  {
40
41
  const dcpConfig = require('dcp/dcp-config');
41
42
  const loggingOptions = {
@@ -117,11 +118,11 @@ Options:
117
118
  switch (option)
118
119
  {
119
120
  case '?':
120
- processExit(1);
121
+ await processExit(1, false);
121
122
  break;
122
123
  case 'h':
123
124
  help();
124
- processExit(0);
125
+ await processExit(0, false);
125
126
  break;
126
127
  case 'P':
127
128
  options.prefix = optarg;
@@ -158,7 +159,7 @@ Options:
158
159
  {
159
160
  const dump = Object.keys(require(options.sandboxDefinitions));
160
161
  console.log(options.json ? JSON.stringify(dump) : dump);
161
- processExit(0);
162
+ await processExit(0);
162
163
  break;
163
164
  }
164
165
  case 'D':
@@ -288,7 +289,7 @@ Options:
288
289
  console.log('Evaluator command:', [path.resolve(options.prefix, options.evaluator)].concat(files).concat(args).join(' '));
289
290
  console.log('Options:', options);
290
291
  }
291
- processExit(0);
292
+ await processExit(0);
292
293
  }
293
294
 
294
295
  if (options.dumpFiles)
@@ -298,7 +299,7 @@ Options:
298
299
  if (options.json)
299
300
  dump = JSON.stringify(dump);
300
301
  console.log(dump);
301
- processExit(0);
302
+ await processExit(0);
302
303
  }
303
304
 
304
305
  if (!options.stdio && options.sandboxType === 'node') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcp-worker",
3
- "version": "4.4.3",
3
+ "version": "4.4.4",
4
4
  "description": "Node.js Worker for Distributive Compute Platform",
5
5
  "main": "bin/dcp-worker",
6
6
  "keywords": [