Skip to content

Commit 46f1408

Browse files
committed
Use constant for seconds
1 parent 539cbe3 commit 46f1408

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

aikido_zen/background_process/realtime/listen_for_config_updates.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
import aikido_zen.background_process.realtime as realtime
1111
from .sse_client import connect_to_sse
1212

13+
# Zen Realtime API should not send config-updated events more than once every 10 seconds
14+
CONFIG_REFRESH_THROTTLE_SECONDS = 9
15+
1316

1417
def listen_for_config_updates(connection_manager, event_scheduler):
1518
"""
@@ -35,8 +38,7 @@ def config_update_arrived_too_fast():
3538
now = time.monotonic()
3639
if (
3740
last_config_refresh_started_at is not None
38-
and now - last_config_refresh_started_at
39-
< 9
41+
and now - last_config_refresh_started_at < CONFIG_REFRESH_THROTTLE_SECONDS
4042
):
4143
return True
4244

0 commit comments

Comments
 (0)