thryyyyy commited on
Commit
04e7384
·
1 Parent(s): b1b97fc

time adjustments

Browse files
Files changed (2) hide show
  1. backend/scripts/backup.py +1 -1
  2. backend/start.sh +3 -3
backend/scripts/backup.py CHANGED
@@ -57,7 +57,7 @@ def backup_db():
57
  raise ValueError("SPACE_ID is not set (or define repo_id manually).")
58
 
59
  # 1) Check if last backup was too recent
60
- threshold_hours = 12
61
  last_backup_dt = get_last_backup_time(space_id, hf_token)
62
  if last_backup_dt is not None:
63
  now = datetime.datetime.utcnow()
 
57
  raise ValueError("SPACE_ID is not set (or define repo_id manually).")
58
 
59
  # 1) Check if last backup was too recent
60
+ threshold_hours = 2
61
  last_backup_dt = get_last_backup_time(space_id, hf_token)
62
  if last_backup_dt is not None:
63
  now = datetime.datetime.utcnow()
backend/start.sh CHANGED
@@ -67,15 +67,15 @@ WEBUI_PID=$!
67
  # 7. Background job for daily backup
68
  (
69
  # Optional: wait a few minutes before the first backup, so the DB is stable
70
- sleep 300
71
 
72
  while true; do
73
  echo "==============================================="
74
  echo "Daily backup job: encrypting and pushing the DB"
75
  echo "==============================================="
76
  python "$SCRIPT_DIR/backup.py"
77
- # Sleep for 24 hours
78
- sleep 86400
79
  done
80
  ) &
81
 
 
67
  # 7. Background job for daily backup
68
  (
69
  # Optional: wait a few minutes before the first backup, so the DB is stable
70
+ sleep 500
71
 
72
  while true; do
73
  echo "==============================================="
74
  echo "Daily backup job: encrypting and pushing the DB"
75
  echo "==============================================="
76
  python "$SCRIPT_DIR/backup.py"
77
+ # Sleep for 8 hours
78
+ sleep 21600
79
  done
80
  ) &
81