From 2b7c62930480797cb4cc4948a40b26e2d2013c82 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 6 Jun 2024 23:06:02 +0200 Subject: [PATCH] hosts: wait 15 minutes before first reboot --- hosts/deploy.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/deploy.nix b/hosts/deploy.nix index 67e8e98..830c75b 100644 --- a/hosts/deploy.nix +++ b/hosts/deploy.nix @@ -30,11 +30,11 @@ in currentTime=$(date +%s) lastScheduledTime=$(consul kv get system/coordinated-reboot/last) if [[ $? -ne 0 ]]; then - lastScheduledTime=$((currentTime - 300)) + lastScheduledTime=$((currentTime - 900)) fi nextScheduledTime=$((lastScheduledTime + 3600)) - if [[ $nextScheduledTime -lt $((currentTime + 300)) ]]; then - nextScheduledTime=$((currentTime + 300)) + if [[ $nextScheduledTime -lt $((currentTime + 900)) ]]; then + nextScheduledTime=$((currentTime + 900)) fi consul kv put system/coordinated-reboot/last $nextScheduledTime echo "Scheduling reboot for $nextScheduledTime"