diff --git a/lib/towerops/exq_supervisor.ex b/lib/towerops/exq_supervisor.ex index 830feb4c..ce39d421 100644 --- a/lib/towerops/exq_supervisor.ex +++ b/lib/towerops/exq_supervisor.ex @@ -72,12 +72,27 @@ defmodule Towerops.ExqSupervisor do namespace: "exq", concurrency: 10, queues: ["default", "discovery", "polling", "monitoring", "maintenance"], - # Increase max retries and backoff for better Redis connection recovery + # Poll settings - how long to wait for Redis responses + poll_timeout: 50, + scheduler_poll_timeout: 200, + scheduler_enable: true, + # Job retry settings max_retries: 50, - # Exponential backoff starting at 500ms - backoff: 500, - # Add shutdown timeout to allow jobs to complete - shutdown_timeout: 25_000 + # Exponential backoff starting at 500ms, up to 60s + mode: :default, + shutdown_timeout: 30_000, + # Redix connection options for better resilience + redis_options: [ + # Synchronous connect to fail fast if Redis unavailable + sync_connect: true, + # Don't exit process on disconnection - let Exq handle it + exit_on_disconnection: false, + # Connection timeout + timeout: 5_000, + # Backoff for reconnection attempts + backoff_initial: 500, + backoff_max: 30_000 + ] ] end end