Spaces:
Running
Running
Update server.py
Browse files
server.py
CHANGED
|
@@ -402,7 +402,7 @@ async def scan_and_compress_videos():
|
|
| 402 |
|
| 403 |
@app.on_event("startup")
|
| 404 |
async def startup_event():
|
| 405 |
-
"""Start compression scan on server startup."""
|
| 406 |
print("\n" + "="*80)
|
| 407 |
print("STARTUP EVENT TRIGGERED")
|
| 408 |
print("="*80)
|
|
@@ -419,8 +419,10 @@ async def startup_event():
|
|
| 419 |
except Exception as e:
|
| 420 |
print(f"✗ Error checking ffmpeg: {e}")
|
| 421 |
|
| 422 |
-
#
|
| 423 |
-
print("
|
|
|
|
|
|
|
| 424 |
await scan_and_compress_videos()
|
| 425 |
|
| 426 |
|
|
|
|
| 402 |
|
| 403 |
@app.on_event("startup")
|
| 404 |
async def startup_event():
|
| 405 |
+
"""Start compression scan on server startup with 30s delay."""
|
| 406 |
print("\n" + "="*80)
|
| 407 |
print("STARTUP EVENT TRIGGERED")
|
| 408 |
print("="*80)
|
|
|
|
| 419 |
except Exception as e:
|
| 420 |
print(f"✗ Error checking ffmpeg: {e}")
|
| 421 |
|
| 422 |
+
# Wait 30 seconds before starting scan
|
| 423 |
+
print("\nWaiting 30 seconds before starting compression scan...")
|
| 424 |
+
await asyncio.sleep(30)
|
| 425 |
+
print("Starting compression scan now...")
|
| 426 |
await scan_and_compress_videos()
|
| 427 |
|
| 428 |
|