Spaces:
Paused
Paused
run hard challenge every 10 minutes for testing
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ INITIAL_DATA = {
|
|
46 |
],
|
47 |
}
|
48 |
|
49 |
-
HARD_CHALLENGE_HOURS_WINDOW =
|
50 |
|
51 |
repo = huggingface_hub.Repository(
|
52 |
local_dir="hf_data",
|
@@ -263,7 +263,8 @@ def run_summary_hard():
|
|
263 |
print("RUNNING SUMMARY HARD AT (UTC time): ", now_utc)
|
264 |
db = sqlite3.connect(DB_FILE)
|
265 |
cur = db.cursor()
|
266 |
-
cutoff_time = now_utc - timedelta(hours=HARD_CHALLENGE_HOURS_WINDOW)
|
|
|
267 |
# select all after cutoff_time
|
268 |
print("cutoff_time: ", cutoff_time)
|
269 |
cur.execute("SELECT * FROM ctf_hard WHERE created_at > ?", (cutoff_time,))
|
@@ -524,7 +525,8 @@ with gr.Blocks(
|
|
524 |
if __name__ == "__main__":
|
525 |
scheduler = BackgroundScheduler()
|
526 |
scheduler.add_job(func=backup_db, trigger="interval", seconds=60)
|
527 |
-
scheduler.add_job(func=run_summary_hard, trigger=CronTrigger(hour=8, timezone=timezone.utc))
|
|
|
528 |
scheduler.start()
|
529 |
create_tables()
|
530 |
demo.launch(debug=False, favicon_path="./assets/favicon-32x32.png")
|
|
|
46 |
],
|
47 |
}
|
48 |
|
49 |
+
HARD_CHALLENGE_HOURS_WINDOW = 24
|
50 |
|
51 |
repo = huggingface_hub.Repository(
|
52 |
local_dir="hf_data",
|
|
|
263 |
print("RUNNING SUMMARY HARD AT (UTC time): ", now_utc)
|
264 |
db = sqlite3.connect(DB_FILE)
|
265 |
cur = db.cursor()
|
266 |
+
# cutoff_time = now_utc - timedelta(hours=HARD_CHALLENGE_HOURS_WINDOW)
|
267 |
+
cutoff_time = now_utc - timedelta(minutes=10)
|
268 |
# select all after cutoff_time
|
269 |
print("cutoff_time: ", cutoff_time)
|
270 |
cur.execute("SELECT * FROM ctf_hard WHERE created_at > ?", (cutoff_time,))
|
|
|
525 |
if __name__ == "__main__":
|
526 |
scheduler = BackgroundScheduler()
|
527 |
scheduler.add_job(func=backup_db, trigger="interval", seconds=60)
|
528 |
+
# scheduler.add_job(func=run_summary_hard, trigger=CronTrigger(hour=8, timezone=timezone.utc))
|
529 |
+
scheduler.add_job(func=run_summary_hard, trigger=CronTrigger(minute="*/10", timezone=timezone.utc))
|
530 |
scheduler.start()
|
531 |
create_tables()
|
532 |
demo.launch(debug=False, favicon_path="./assets/favicon-32x32.png")
|