diff --git a/terraform/modules/daily_snapshot/service/daily_snapshot.rb b/terraform/modules/daily_snapshot/service/daily_snapshot.rb index 4c4aed1ce..2de360748 100644 --- a/terraform/modules/daily_snapshot/service/daily_snapshot.rb +++ b/terraform/modules/daily_snapshot/service/daily_snapshot.rb @@ -46,7 +46,7 @@ def latest_snapshot_date(chain_name = 'calibnet') add_timestamps_cmd = "awk '{ if ($0 !~ /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z/) print strftime(\"[%Y-%m-%d %H:%M:%S]\"), $0; else print $0; fflush(); }'" # Sync and export snapshot -snapshot_uploaded = system("bash -c 'timeout --signal=KILL 24h ./upload_snapshot.sh #{CHAIN_NAME} #{LOG_EXPORT_DAEMON} #{LOG_EXPORT_METRICS}' | #{add_timestamps_cmd} > #{LOG_EXPORT_SCRIPT_RUN} 2>&1") +snapshot_uploaded = system("set -o pipefail && bash -c 'timeout --signal=KILL 8h ./upload_snapshot.sh #{CHAIN_NAME} #{LOG_EXPORT_DAEMON} #{LOG_EXPORT_METRICS}' | #{add_timestamps_cmd} > #{LOG_EXPORT_SCRIPT_RUN} 2>&1") if snapshot_uploaded date_after_export = latest_snapshot_date(CHAIN_NAME) diff --git a/terraform/modules/daily_snapshot/service/upload_snapshot.sh b/terraform/modules/daily_snapshot/service/upload_snapshot.sh index a8bf8822c..9ce9b8a73 100755 --- a/terraform/modules/daily_snapshot/service/upload_snapshot.sh +++ b/terraform/modules/daily_snapshot/service/upload_snapshot.sh @@ -1,7 +1,7 @@ #!/bin/bash -# If Forest hasn't synced to the network after 8 hours, something has gone wrong. -SYNC_TIMEOUT=8h +# If Forest hasn't synced to the network after 3 hours, something has gone wrong. +SYNC_TIMEOUT=3h if [[ $# != 3 ]]; then echo "Usage: bash $0 CHAIN_NAME LOG_EXPORT_DAEMON LOG_EXPORT_METRICS"