mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-08-14 14:40:00 +00:00
Move the 15-minute gap between cycles from the DM command to the service, as MIN_CYCLE_GAP_SECONDS. The command was one caller among several: the scheduler retried a failed cycle on its own 300s backoff, keyed off last_neighbors_publish which a failed cycle never stamps, so a discover round whose acknowledgement was lost went back on the air every five minutes. run_neighbors_cycle now refuses a cycle inside the gap whoever asks, and the scheduler's retry backoff waits out whatever remains of it. Failures that never reached the radio still stamp nothing, so re-checking a disconnected radio stays on the short backoff. The command asks the service for the remaining wait instead of computing its own, so the two cannot drift, and rewinds the sender's per-user cooldown to expire with the shared one. The command manager records an execution before calling execute(), so a refusal had been consuming the sender's full 15 minutes: told to wait one more minute, they would retry and be refused for another fourteen. Rewound rather than cleared — a refusal reply is airtime too.