Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -909,13 +909,13 @@ async def startup_event():
|
|
| 909 |
app.state.drive_watcher = DriveWatcher()
|
| 910 |
app.state.drive_service = build('drive', 'v3', credentials=APICredential)
|
| 911 |
|
| 912 |
-
#
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
|
| 920 |
# Initial update of watch list channels
|
| 921 |
app.state.drive_watcher.update_watch_list()
|
|
|
|
| 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 |
+
|
| 919 |
|
| 920 |
# Initial update of watch list channels
|
| 921 |
app.state.drive_watcher.update_watch_list()
|