pitaya
pitaya copied to clipboard
fix(nats): wait for reconnects on setup
Ported from v2 #439
If the initial connect fails, NATS will spawn reconnect async handlers. Thus, we need to wait for all reconnects to be attempted before returning to the caller, otherwise, we won't be making use of reconnections.
- fix(app): init sig chan as buffered
- fix(etcd): prevent shutdown from crashing app
If the etcd module shuts down before all connections are set up, it will crash trying to access sd.cli where it's still nil. Thus, adding a check on shutdown