@certik/skynet 0.10.32 → 0.10.33
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 +4 -0
- package/app.js +13 -4
- package/monitor.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/app.js
CHANGED
|
@@ -609,13 +609,22 @@ function api({ name, routes, serve, beforeListen, env = {}, region = "us-east-1"
|
|
|
609
609
|
func: async () => {
|
|
610
610
|
const errors = [];
|
|
611
611
|
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
try {
|
|
613
|
+
const url = `http://localhost:9999${serve.prefix}/`;
|
|
614
|
+
const res = await fetch(url);
|
|
615
|
+
|
|
616
|
+
if (!res.ok) {
|
|
617
|
+
errors.push({
|
|
618
|
+
type: ERROR_LEVEL.ERROR,
|
|
619
|
+
message: `service ${name} is unhealthy`,
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
} catch (fetchErr) {
|
|
623
|
+
console.log(`error fetching ${url}`, fetchErr);
|
|
614
624
|
|
|
615
|
-
if (!res.ok) {
|
|
616
625
|
errors.push({
|
|
617
626
|
type: ERROR_LEVEL.ERROR,
|
|
618
|
-
message: `service ${name} is
|
|
627
|
+
message: `service ${name} is unhealthy`,
|
|
619
628
|
});
|
|
620
629
|
}
|
|
621
630
|
|
package/monitor.js
CHANGED