Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ from apscheduler.schedulers.background import BackgroundScheduler
|
|
| 37 |
|
| 38 |
from google.cloud.firestore import AsyncClient
|
| 39 |
import asyncio
|
| 40 |
-
|
| 41 |
|
| 42 |
|
| 43 |
|
|
@@ -909,12 +909,13 @@ async def startup_event():
|
|
| 909 |
app.state.drive_watcher = DriveWatcher()
|
| 910 |
app.state.drive_service = build('drive', 'v3', credentials=APICredential)
|
| 911 |
|
| 912 |
-
# Fetch all users and initialize the watch list
|
| 913 |
-
users = users_collection_ref.get()
|
| 914 |
-
for user in users:
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
|
|
|
| 918 |
|
| 919 |
# Initial update of watch list channels
|
| 920 |
app.state.drive_watcher.update_watch_list()
|
|
|
|
| 37 |
|
| 38 |
from google.cloud.firestore import AsyncClient
|
| 39 |
import asyncio
|
| 40 |
+
from googleapiclient.errors import HttpError
|
| 41 |
|
| 42 |
|
| 43 |
|
|
|
|
| 909 |
app.state.drive_watcher = DriveWatcher()
|
| 910 |
app.state.drive_service = build('drive', 'v3', credentials=APICredential)
|
| 911 |
|
| 912 |
+
# # Fetch all users and initialize the watch list
|
| 913 |
+
# users = users_collection_ref.get()
|
| 914 |
+
# for user in users:
|
| 915 |
+
# user_data = user.to_dict()
|
| 916 |
+
# if 'gDrive_metadata' in user_data and 'uploaded' in user_data['gDrive_metadata']:
|
| 917 |
+
# app.state.drive_watcher.watch_list[user.id] = user_data['gDrive_metadata']['uploaded']
|
| 918 |
+
app.state.drive_watcher.watch_list["xJs8nDUdbVWvq1QIKY3VYmFkidn1"] = "1paIWJDmlLyWaGsB_eXrpP7ILZiw3Xb70"
|
| 919 |
|
| 920 |
# Initial update of watch list channels
|
| 921 |
app.state.drive_watcher.update_watch_list()
|