diff --git a/app/__init__.py b/app/__init__.py index f88132d..2fd4454 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -59,7 +59,7 @@ def _mask(value: str, visible: int = 4) -> str: app.config["CLOUDFLARE_API_TOKEN"] = os.getenv("CLOUDFLARE_API_TOKEN") app.config["CLOUDFLARE_ACCOUNT_ID"] = os.getenv("CLOUDFLARE_ACCOUNT_ID") app.config["CLOUDFLARE_ZONE_ID"] = os.getenv("CLOUDFLARE_ZONE_ID") -app.config["PING_HEARTBEAT_TIMEOUT_SECONDS"] = os.getenv("PING_HEARTBEAT_TIMEOUT_SECONDS",5) # How long before a Websocket PING\PONG is classed as a failure and triggers a worker offline event +app.config["PING_HEARTBEAT_TIMEOUT_SECONDS"] = os.getenv("PING_HEARTBEAT_TIMEOUT_SECONDS",30) # How long before a Websocket PING\PONG is classed as a failure and triggers a worker offline event app.config["REDIS_URL"] = os.getenv("REDIS_URL","redis://172.17.0.1:6379/2") # Redis Database 2 for operational tasks like websocket server and PING logging logger.info( diff --git a/app/celery_app.py b/app/celery_app.py index f9d4284..0bf132a 100644 --- a/app/celery_app.py +++ b/app/celery_app.py @@ -27,7 +27,7 @@ celery.conf.beat_schedule.update( }, "reconcile_online_workers-30s": { "task": "tasks.reconcile_online_workers", - "schedule": 2.0, + "schedule": 30.0, }, # Add more periodic jobs here if desired # "collect-system-metrics": { diff --git a/websocket_server/config.py b/websocket_server/config.py index e1ef95e..4acd4be 100644 --- a/websocket_server/config.py +++ b/websocket_server/config.py @@ -14,11 +14,12 @@ REDIS_URL = "redis://172.17.0.1:6379/2" # Configurable intervals -PING_INTERVAL_SECONDS = 2 # How often to send PING requests -REDIS_PING_EXPIRY_SECONDS = 30 # Redis key expiry value +PING_INTERVAL_SECONDS = 15 # How often to send PING requests +REDIS_PING_EXPIRY_SECONDS = 120 # Redis key expiry value +PING_EXPIRY_SECONDS = 5 # How long between PING and PONG before we raise the alarm - TODO - Impliment this + ASSIGN_INTERVAL_SECONDS = 30 LIVENESS_CHECK_INTERVAL_SECONDS = 5 # How often to cross check connected_workers with ping results from Redis -PING_EXPIRY_SECONDS = 3 # How long between PING and PONG before we raise the alarm # Database configuration