feat: enhance execution logger to report usage only on count change

This commit is contained in:
Abolfazl
2026-05-02 16:12:35 +03:30
parent 7e052ad1b2
commit 64d900cdfe
+5 -2
View File
@@ -264,12 +264,15 @@ class DomainFronter:
self._exec_total += count self._exec_total += count
async def _execution_logger(self): async def _execution_logger(self):
"""Log execution usage every N seconds.""" """Log execution usage every N seconds, only when the count changed."""
interval = self._execution_report_interval interval = self._execution_report_interval
last_reported = -1
while True: while True:
try: try:
await asyncio.sleep(interval) await asyncio.sleep(interval)
log.info("Apps Script executions used so far: %d", self._exec_total) if self._exec_total != last_reported:
last_reported = self._exec_total
log.info("Apps Script executions used so far: %d", self._exec_total)
except asyncio.CancelledError: except asyncio.CancelledError:
break break
except Exception as exc: except Exception as exc: