Files
proxmox/scripts/maintenance/schedule-explorer-lag-cron.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

48 lines
1.6 KiB
Bash

#!/usr/bin/env bash
# Schedule cron to check explorer indexer lag and run fix when lag > threshold.
# Run from project root. Use a host that can reach RPC and Blockscout (and SSH to r630-02 for fix).
# Usage: bash scripts/maintenance/schedule-explorer-lag-cron.sh [--install|--show|--remove]
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
LAG_SCRIPT="$PROJECT_ROOT/scripts/maintenance/check-and-fix-explorer-lag.sh"
LOG_DIR="$PROJECT_ROOT/logs"
LOG_FILE="$LOG_DIR/explorer-lag-fix.log"
# Every 6 hours (0:00, 6:00, 12:00, 18:00)
CRON_LAG="0 */6 * * * cd $PROJECT_ROOT && bash $LAG_SCRIPT >> $LOG_FILE 2>&1"
case "${1:-}" in
--install)
mkdir -p "$LOG_DIR"
if crontab -l 2>/dev/null | grep -q "check-and-fix-explorer-lag.sh"; then
echo "Explorer lag cron already present in crontab."
else
(crontab -l 2>/dev/null; echo "$CRON_LAG") | crontab -
echo "Installed explorer lag cron (every 6 hours):"
echo " $CRON_LAG"
echo "Log: $LOG_FILE"
fi
;;
--show)
echo "Explorer lag check-and-fix (every 6 hours):"
echo " $CRON_LAG"
echo "Log: $LOG_FILE"
echo "Threshold: set EXPLORER_INDEXER_LAG_THRESHOLD (default 500) in crontab or env."
;;
--remove)
if crontab -l 2>/dev/null | grep -q "check-and-fix-explorer-lag.sh"; then
crontab -l 2>/dev/null | grep -v "check-and-fix-explorer-lag.sh" | crontab -
echo "Removed explorer lag cron."
else
echo "No explorer lag cron found in crontab."
fi
;;
*)
echo "Usage: $0 [--install|--show|--remove]"
exit 0
;;
esac