factorstudios commited on
Commit
77caf02
·
verified ·
1 Parent(s): 28e85cb

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +5 -3
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
- # Schedule scan immediately instead of with delay
423
- print("Starting compression scan immediately...")
 
 
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