mirror of
https://github.com/masterking32/MasterHttpRelayVPN.git
synced 2026-05-17 21:24:37 +03:00
feat: enhance execution logger to report usage only on count change
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user