Skip to content

Commit 7b61328

Browse files
committed
zonewriter: change sleep between iterations to be more then 1 second and add jitter
1 parent 7e946ba commit 7b61328

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cwm_cdn_api/zone_writer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import asyncio
77
import signal
88
import subprocess
9+
import random
910

1011
import orjson
1112

@@ -43,7 +44,7 @@ async def main_daemon(zones_dir):
4344
await main(zones_dir, daemon=False)
4445
if stop.is_set():
4546
break
46-
await asyncio.sleep(1)
47+
await asyncio.sleep(1.1 + random.uniform(0, 0.4))
4748

4849

4950
async def iterate_tenant_domains():

0 commit comments

Comments
 (0)