Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -992,10 +992,10 @@ async def notifications(request: Request):
|
|
| 992 |
# Set up the Firebase listener
|
| 993 |
users_watch = users_collection_ref.on_snapshot(on_snapshot)
|
| 994 |
|
| 995 |
-
#
|
| 996 |
-
|
| 997 |
-
|
| 998 |
-
|
| 999 |
|
| 1000 |
# # Startup event to initialize the watch list
|
| 1001 |
# @app.on_event("startup")
|
|
|
|
| 992 |
# Set up the Firebase listener
|
| 993 |
users_watch = users_collection_ref.on_snapshot(on_snapshot)
|
| 994 |
|
| 995 |
+
# Set up the scheduler to update watch list every 24 hours
|
| 996 |
+
scheduler = BackgroundScheduler()
|
| 997 |
+
scheduler.add_job(update_watch_list, 'interval', hours=24)
|
| 998 |
+
scheduler.start()
|
| 999 |
|
| 1000 |
# # Startup event to initialize the watch list
|
| 1001 |
# @app.on_event("startup")
|