fix(runner): retry failed services after one minute and fail fast on bad config

A failed connect or tick now closes the connection and reconnects after one
minute, re-running initialization so a dropped table or row is recreated.
Before, a failing tick logged every interval forever and connect retries
logged every 10 seconds.

Connection URLs that fail to parse no longer appear in logs, since their
error repeats the password.

An unknown adapter or a missing required config key now stops keepalive at
startup instead of silently idling one service.
This commit is contained in:
tiennm99 committed 2026-10-09 11:10:45 +07:00
1 parent 30fd62a46c
commit 42c8a871cf
5 files changed
+168 -32

No files matched your search

+6
View File
@@ -105,6 +105,12 @@ func normalizeConfig(raw appConfig) ([]serviceConfig, error) {
}
cfg["counter_key"] = valueOrDefault(rawService.CounterKey, globalCounterKey)
// Factories do no I/O, so building one here catches an unknown adapter
// or a missing config key at startup instead of silently idling.
if _, err := adapter.New(adapterType, cfg); err != nil {
return nil, fmt.Errorf("%s: %w", servicePath, err)
}
name, err := normalizeServiceName(rawService.Name, adapterType, cfg, usedNames, servicePath)
if err != nil {
return nil, err