Boot-DM publish fails on startup — wait for a connected relay instead of a fixed sleep #48
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On the
aio-demodeploy of the nostr-tools build (#45), the boot-time admin DM failed at startup:notifyAdminsOfNewConnectionspins up a throwawayRelayPoolto two external public relays, waits a fixed2500ms, then publishes the DM. Those relays are often slow to connect, so the fixed wait (+ the ~1.2s publish retry budget) can elapse before any connection is up → the publish fails.Non-critical: it's caught and logged by
dmUser; the daemon reaches "ready to serve" before this and runs fine. But it's a noisy error on every boot whennotifyAdminsOnBootis set.Fix: poll
pool.connectedCount() > 0up to a cap (~8s) before publishing, instead of the fixed sleep — succeed as soon as a relay is up, still best-effort (fall through + log if none connect). Small isolated change inadmin/index.ts.Refs: #45 (where the DM was ported to nostr-tools), #44.