@certik/skynet 0.10.32 → 0.10.35

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.35
4
+
5
+ - Set better process name
6
+
7
+ ## 0.10.33 & 0.10.34
8
+
9
+ - Fixed api monitor error messages
10
+
3
11
  ## 0.10.32
4
12
 
5
13
  - Changed deploy to add a SKYNET_DEPLOYED_AT variable to ensure new deployment would always be triggered in nomad
package/app.js CHANGED
@@ -189,6 +189,8 @@ function indexer({ name, selector, build, check, env = {}, region = "us-east-1"
189
189
  });
190
190
 
191
191
  run();
192
+
193
+ process.title = name;
192
194
  },
193
195
  onDeploy: () => {
194
196
  const bin = detectBin();
@@ -295,6 +297,8 @@ function modeIndexer({ name, selector, state, build, validate, check, env = {},
295
297
  });
296
298
 
297
299
  run();
300
+
301
+ process.title = name;
298
302
  },
299
303
  onDeploy: () => {
300
304
  const bin = detectBin();
@@ -411,6 +415,8 @@ function producer({ name, selector, produce, check, state, env = {}, region = "u
411
415
  });
412
416
 
413
417
  run();
418
+
419
+ process.title = name;
414
420
  },
415
421
  onDeploy: () => {
416
422
  const bin = detectBin();
@@ -507,6 +513,8 @@ function consumer({ name, selector, consume, check, env = {}, region = "us-east-
507
513
  });
508
514
 
509
515
  run();
516
+
517
+ process.title = name;
510
518
  },
511
519
  onDeploy: () => {
512
520
  const bin = detectBin();
@@ -608,14 +616,23 @@ function api({ name, routes, serve, beforeListen, env = {}, region = "us-east-1"
608
616
  const check = {
609
617
  func: async () => {
610
618
  const errors = [];
611
-
612
619
  const url = `http://localhost:9999${serve.prefix}/`;
613
- const res = await fetch(url);
614
620
 
615
- if (!res.ok) {
621
+ try {
622
+ const res = await fetch(url);
623
+
624
+ if (!res.ok) {
625
+ errors.push({
626
+ type: ERROR_LEVEL.ERROR,
627
+ message: `service ${name} is unhealthy`,
628
+ });
629
+ }
630
+ } catch (fetchErr) {
631
+ console.log(`error fetching ${url}`, fetchErr);
632
+
616
633
  errors.push({
617
634
  type: ERROR_LEVEL.ERROR,
618
- message: `service ${name} is not healthy`,
635
+ message: `service ${name} is unhealthy`,
619
636
  });
620
637
  }
621
638
 
@@ -635,7 +652,7 @@ function api({ name, routes, serve, beforeListen, env = {}, region = "us-east-1"
635
652
  env,
636
653
  check,
637
654
  onRun: () => {
638
- return startApiApp({
655
+ startApiApp({
639
656
  binaryName: `${getBinaryName()} run`,
640
657
  name,
641
658
  selector,
@@ -643,6 +660,8 @@ function api({ name, routes, serve, beforeListen, env = {}, region = "us-east-1"
643
660
  serve,
644
661
  beforeListen,
645
662
  });
663
+
664
+ process.title = name;
646
665
  },
647
666
  onDeploy: () => {
648
667
  const bin = detectBin();
package/monitor.js CHANGED
@@ -132,7 +132,7 @@ ${
132
132
  } catch (err) {
133
133
  console.log(`[MONITOR] got error in check`, err);
134
134
 
135
- return [`${err.message}`];
135
+ return [{ type: ERROR_LEVEL.ERROR, message: `${err.message}` }];
136
136
  }
137
137
  },
138
138
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.10.32",
3
+ "version": "0.10.35",
4
4
  "description": "Skynet Shared JS library",
5
5
  "main": "index.js",
6
6
  "author": "CertiK Engineering",