diff --git a/README.md b/README.md index a312e49..381df76 100644 --- a/README.md +++ b/README.md @@ -334,8 +334,10 @@ systemctl status ibkr-gateway-daily-restart.timer --no-pager then restarts and finally recreates the container if the API does not recover. `ibkr-gateway-daily-restart.timer` restarts the Gateway once per day at -`10:30 UTC` by default, then waits for the same API handshake readiness. Override -the schedule during install with: +`10:30 UTC` by default, then waits for the same API handshake readiness. Missed +daily restart times are not replayed when the timer is started manually, so +re-enabling the timer during a maintenance window does not immediately restart +an already-authenticated Gateway. Override the schedule during install with: ```bash IB_GATEWAY_DAILY_RESTART_ON_CALENDAR='Mon..Fri 10:30:00 UTC' sudo bash ./scripts/install_gateway_health_watcher.sh diff --git a/scripts/install_gateway_health_watcher.sh b/scripts/install_gateway_health_watcher.sh index 94c8bc0..2470c13 100755 --- a/scripts/install_gateway_health_watcher.sh +++ b/scripts/install_gateway_health_watcher.sh @@ -79,7 +79,7 @@ Description=Restart IBKR Gateway on a fixed daily schedule [Timer] OnCalendar=$daily_restart_calendar -Persistent=true +Persistent=false Unit=$IBKR_GATEWAY_DAILY_RESTART_SERVICE [Install] diff --git a/tests/test_gateway_recovery_scripts.sh b/tests/test_gateway_recovery_scripts.sh index f3ce1f1..9b63b8d 100644 --- a/tests/test_gateway_recovery_scripts.sh +++ b/tests/test_gateway_recovery_scripts.sh @@ -59,6 +59,7 @@ grep -Fq 'Environment=COMPOSE_FILE=$compose_file' "$health_watcher_script" grep -Fq 'Environment=IB_GATEWAY_RECOVERY_LOCK_FILE=$recovery_lock_file' "$health_watcher_script" grep -Fq 'Environment=IB_GATEWAY_RECOVERY_LOCK_WAIT_SECONDS=0' "$health_watcher_script" grep -Fq 'OnActiveSec=$health_interval_seconds' "$health_watcher_script" +grep -Fq 'Persistent=false' "$health_watcher_script" ! grep -Fq 'OnBootSec=5min' "$health_watcher_script" grep -Fq 'enable --now "$IBKR_GATEWAY_HEALTHCHECK_TIMER"' "$health_watcher_script" grep -Fq 'enable --now "$IBKR_GATEWAY_DAILY_RESTART_TIMER"' "$health_watcher_script"