dcp-worker 4.4.2 → 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.
- package/bin/dcp-evaluator-start +9 -8
- package/lib/utils.js +2 -2
- package/package.json +1 -1
- package/www/hud/small-dark.html +1 -0
package/bin/dcp-evaluator-start
CHANGED
|
@@ -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
|
-
|
|
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/lib/utils.js
CHANGED
|
@@ -207,9 +207,9 @@ async function registerWorker(worker, rkey, label, errorReporter)
|
|
|
207
207
|
return errorReporter('invalid registration key');
|
|
208
208
|
|
|
209
209
|
if (label)
|
|
210
|
-
debug('dcp-worker:registration')('registering worker with key', rkey, 'and label', label);
|
|
210
|
+
debug('dcp-worker:registration')('registering worker with key', rkey.slice(0,8), 'and label', label);
|
|
211
211
|
else
|
|
212
|
-
debug('dcp-worker:registration')('registering worker with key', rkey);
|
|
212
|
+
debug('dcp-worker:registration')('registering worker with key', rkey.slice(0,8));
|
|
213
213
|
|
|
214
214
|
const reg = await worker.register(rkey, label);
|
|
215
215
|
if (!(reg instanceof Error))
|
package/package.json
CHANGED
package/www/hud/small-dark.html
CHANGED
|
@@ -394,6 +394,7 @@ class DistributiveWorkerLink
|
|
|
394
394
|
<center><h3>DCP Worker</h3></center>
|
|
395
395
|
</div>
|
|
396
396
|
<table>
|
|
397
|
+
<tr><th>Worker Id:</th> <td run-info="workerId" class="dcp-fixed-font"></td></tr>
|
|
397
398
|
<tr><th>Running Since:</th> <td run-info="startTime"></td></tr>
|
|
398
399
|
<tr><th>Earnings Since Start:</th> <td run-info="totalEarnings" class="dcp-amount"></td></tr>
|
|
399
400
|
<tr><th>Earnings Account:</th> <td run-info="earningsAccount" class="dcp-fixed-font"></td></tr>
|