dcp-worker 3.2.14 → 3.2.16

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.
Files changed (2) hide show
  1. package/bin/dcp-worker +35 -25
  2. package/package.json +8 -7
package/bin/dcp-worker CHANGED
@@ -342,23 +342,31 @@ async function startWorking(cliArgs) {
342
342
  syslogPort: cliArgs.syslogPort,
343
343
  });
344
344
 
345
- require('../lib/remote-console').init(cliArgs.replPort, {
346
- help: {
347
- report: 'Print a worker status & slice report',
348
- kill: 'Kill the worker',
349
- },
350
- commands: {
351
- report: printReport,
352
- kill: exitcode => exitGuard.exit(exitcode),
353
- },
354
- });
355
- require('../lib/remote-console').setMainEval(function mainEval() { return eval(arguments[0]) });
345
+ try
346
+ {
347
+ require('../lib/remote-console').init(cliArgs.replPort, {
348
+ help: {
349
+ report: 'Print a worker status & slice report',
350
+ kill: 'Kill the worker',
351
+ },
352
+ commands: {
353
+ report: printReport,
354
+ kill: exitcode => exitGuard.exit(exitcode),
355
+ },
356
+ });
357
+ require('../lib/remote-console').setMainEval(function mainEval() { return eval(arguments[0]) });
358
+ }
359
+ catch (error)
360
+ {
361
+ console.warn('350: Failed to initialize remote console:', error.message);
362
+ }
356
363
 
357
- console.log(` * Starting DCP Worker`);
358
- console.log(` . Configured for scheduler ${dcpConfig.scheduler.location}`);
359
- console.log(` . Bank is ${dcpConfig.bank.location}`);
360
- console.log(` . Earned funds will be deposited in account ${paymentAddress}`);
361
- console.log(` . Identity is ${identityKeystore.address}`);
364
+ let introBanner = '';
365
+ introBanner += ` * Starting DCP Worker` + '\n';
366
+ introBanner += ` . Configured for scheduler ${dcpConfig.scheduler.location}` + '\n';
367
+ introBanner += ` . Bank is ${dcpConfig.bank.location}` + '\n';
368
+ introBanner += ` . Earned funds will be deposited in account ${paymentAddress}` + '\n';
369
+ introBanner += ` . Identity is ${identityKeystore.address}` + '\n';
362
370
 
363
371
  function qty(amount, singular, plural) /* XXX i18n */
364
372
  {
@@ -374,22 +382,24 @@ async function startWorking(cliArgs) {
374
382
  }
375
383
 
376
384
  if (dcpWorkerOptions.jobAddresses)
377
- console.log(` * Processing only ${qty(dcpWorkerOptions.jobAddresses, 'job')}`, dcpWorkerOptions.jobAddresses.join(', '));
385
+ introBanner += ` * Processing only ${qty(dcpWorkerOptions.jobAddresses, 'job')} ` + dcpWorkerOptions.jobAddresses.join(', ') + '\n';
378
386
  if (dcpWorkerOptions.computeGroups.length)
379
- console.log(` * Joining compute ${qty(dcpWorkerOptions.computeGroups, 'group')}`, dcpWorkerOptions.computeGroups.map(el => el.joinKey).join(', '));
387
+ introBanner += ` * Joining compute ${qty(dcpWorkerOptions.computeGroups, 'group')} ` + dcpWorkerOptions.computeGroups.map(el => el.joinKey).join(', ') + '\n';
380
388
  if (dcpWorkerOptions.publicGroupFallback)
381
- console.log(' * Falling back on public group when preferred groups have no work');
389
+ introBanner += ' * Falling back on public group when preferred groups have no work' + '\n';
382
390
  else if (dcpWorkerOptions.leavePublicGroup)
383
- console.log(' * Leaving the public compute group');
391
+ introBanner += ' * Leaving the public compute group' + '\n';
384
392
  if (cliArgs.verbose)
385
- console.log(` + Verbosity level: ${cliArgs.verbose}`);
393
+ introBanner += ` + Verbosity level: ${cliArgs.verbose}` + '\n';
386
394
  if (cliArgs.eventDebug)
387
- console.log(' + Event debug on');
388
- console.log(' . output mode: ' + cliArgs.output);
395
+ introBanner += ' + Event debug on' + '\n';
396
+ introBanner += ' . output mode: ' + cliArgs.outputMode + '\n';
389
397
 
390
- require('../lib/check-scheduler-version').check();
398
+ introBanner += ' . ready' + '\n';
399
+
400
+ console.log(introBanner);
391
401
 
392
- console.log(' . ready');
402
+ require('../lib/check-scheduler-version').check();
393
403
 
394
404
 
395
405
  /** print the slice report via console.log */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcp-worker",
3
- "version": "3.2.14",
3
+ "version": "3.2.16",
4
4
  "description": "JavaScript portion of DCP Workers for Node.js",
5
5
  "main": "bin/dcp-worker",
6
6
  "keywords": [
@@ -34,13 +34,14 @@
34
34
  "dependencies": {
35
35
  "blessed": "^0.1.81",
36
36
  "blessed-contrib": "^4.11.0",
37
- "bravojs": "^1.0.15",
38
- "chalk": "^4.1.1",
39
- "dcp-client": "^4.2.17",
40
- "kvin": "^1.2.7",
41
- "semver": "^7.3.5"
37
+ "bravojs": "^1.0.16",
38
+ "chalk": "^4.1.0",
39
+ "dcp-client": "^4.2.21",
40
+ "semver": "^7.3.8"
41
+ },
42
+ "optionalDependencies": {
43
+ "telnet-console": "^1.0.4"
42
44
  },
43
- "optionalDependencies": {},
44
45
  "devDependencies": {
45
46
  "@kingsds/eslint-config": "1.0.1",
46
47
  "eslint": "7.30.0"