Skip to content

Commit fecb2be

Browse files
committed
fix: minor service healthcheck fixes
1 parent 9c73713 commit fecb2be

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/fasset-bots-cli/src/run/run-agent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "dotenv/config";
22
import "source-map-support/register";
33

4-
import { AgentBotRunner, PricePublisherService, startActivityTimestampUpdater, startHealthcheckMonitor, stopActivityTimestampUpdater, TimeKeeperService, TimekeeperTimingConfig } from "@flarenetwork/fasset-bots-core";
4+
import { AgentBotRunner, PricePublisherService, startActivityTimestampUpdater, startHealthcheckMonitor, stopActivityTimestampUpdater, stopHealthcheckMonitor, TimeKeeperService, TimekeeperTimingConfig } from "@flarenetwork/fasset-bots-core";
55
import { closeBotConfig, createBotConfig, loadAgentConfigFile, Secrets } from "@flarenetwork/fasset-bots-core/config";
66
import { assertCmd, assertNotNullCmd, authenticatedHttpProvider, CommandLineError, formatFixed, initWeb3, isNotNull, logger, sendWeb3Transaction, toBN, toBNExp, web3 } from "@flarenetwork/fasset-bots-core/utils";
77
import BN from "bn.js";
@@ -124,6 +124,7 @@ program.action(async () => {
124124
await pricePublisherService.stop();
125125
}
126126
stopActivityTimestampUpdater();
127+
stopHealthcheckMonitor();
127128
await timekeeperService.stopAll();
128129
await closeBotConfig(botConfig);
129130
}

packages/fasset-bots-core/src/actors/service-health-checker.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,18 @@ async function serviceHealthcheck(
7676
const dalHealth = await checkDalHealth(c.flareDataConnector)
7777
const walletHealth = await checkUnderlyingWalletHealth(c.wallet)
7878
if (rpcHealth != null) {
79-
errors.push(['native rpc', rpcHealth])
79+
errors.push(['Native RPC', rpcHealth])
8080
} else if (indexerHealth != null) {
8181
errors.push(['FDC verifier', indexerHealth])
8282
} else if (dalHealth != null) {
8383
errors.push(['DAL', dalHealth])
8484
} else if (walletHealth != null) {
85-
errors.push(['underlying rpc', walletHealth])
85+
errors.push(['Underlying RPC', walletHealth])
8686
}
8787
}
8888
for (const [service, reason] of errors) {
89-
notifier.serviceUnhealthy(service, reason)
89+
logger.error(`Service ${service} is unhealthy: ${reason}`)
90+
await notifier.serviceUnhealthy(service, reason)
9091
}
9192
}
9293

0 commit comments

Comments
 (0)