fix(collector): add 0.3s throttle between multi-project command polls to prevent rate limit bursts
This commit is contained in:
@@ -227,6 +227,7 @@ class CollectorBridge:
|
|||||||
fname = f"{cmd_id}.json"
|
fname = f"{cmd_id}.json"
|
||||||
self.local.write_json("commands", fname, cmd)
|
self.local.write_json("commands", fname, cmd)
|
||||||
logger.info(f"[COLLECTOR] ← Gateway: command [{project}] {cmd.get('text', '?')[:30]}")
|
logger.info(f"[COLLECTOR] ← Gateway: command [{project}] {cmd.get('text', '?')[:30]}")
|
||||||
|
await asyncio.sleep(0.3) # Throttle between projects to avoid rate limit bursts
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"[COLLECTOR] poll_commands error: {e}")
|
logger.error(f"[COLLECTOR] poll_commands error: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user