+6
-6
@@ -597,9 +597,9 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"ERROR: Failed processing TV series {item}: {e}")
|
print(f"ERROR: Failed processing TV series {item}: {e}")
|
||||||
|
|
||||||
# Yield control every 3 TV series to allow other requests
|
# Yield control every TV series to allow other requests
|
||||||
if tv_count % 3 == 0:
|
if tv_count % 1 == 0:
|
||||||
await asyncio.sleep(0.01) # 10ms yield to process other requests
|
await asyncio.sleep(0.2) # 200ms yield to process other requests
|
||||||
print(f"INFO: Processed {tv_count} TV series, yielding to other requests...")
|
print(f"INFO: Processed {tv_count} TV series, yielding to other requests...")
|
||||||
|
|
||||||
if scan_type in ["both", "movies"] and scan_path in config.movie_paths:
|
if scan_type in ["both", "movies"] and scan_path in config.movie_paths:
|
||||||
@@ -614,9 +614,9 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"ERROR: Failed processing movie {item}: {e}")
|
print(f"ERROR: Failed processing movie {item}: {e}")
|
||||||
|
|
||||||
# Yield control every 5 movies to allow other requests (webhooks, web interface)
|
# Yield control every 2 movies to allow other requests (webhooks, web interface)
|
||||||
if movie_count % 5 == 0:
|
if movie_count % 2 == 0:
|
||||||
await asyncio.sleep(0.01) # 10ms yield to process other requests
|
await asyncio.sleep(0.2) # 200ms yield to process other requests
|
||||||
print(f"INFO: Processed {movie_count} movies, yielding to other requests...")
|
print(f"INFO: Processed {movie_count} movies, yielding to other requests...")
|
||||||
|
|
||||||
print(f"INFO: Completed movie scan: {movie_count} movies processed in {scan_path}")
|
print(f"INFO: Completed movie scan: {movie_count} movies processed in {scan_path}")
|
||||||
|
|||||||
@@ -100,10 +100,10 @@ class TVProcessor:
|
|||||||
_log("ERROR", f"S{season:02d}E{episode:02d}: Database write failed: {e}")
|
_log("ERROR", f"S{season:02d}E{episode:02d}: Database write failed: {e}")
|
||||||
# Continue processing other episodes
|
# Continue processing other episodes
|
||||||
|
|
||||||
# Yield control every 10 episodes to allow other requests (webhooks, web interface)
|
# Yield control every 3 episodes to allow other requests (webhooks, web interface)
|
||||||
if episode_count % 10 == 0:
|
if episode_count % 3 == 0:
|
||||||
import time
|
import time
|
||||||
time.sleep(0.005) # 5ms yield to improve responsiveness during episode processing
|
time.sleep(0.1) # 100ms yield to improve responsiveness during episode processing
|
||||||
_log("DEBUG", f"Processed {episode_count} episodes, yielding to allow other requests...")
|
_log("DEBUG", f"Processed {episode_count} episodes, yielding to allow other requests...")
|
||||||
|
|
||||||
# Skip season.nfo and tvshow.nfo creation - focus only on episode NFOs
|
# Skip season.nfo and tvshow.nfo creation - focus only on episode NFOs
|
||||||
|
|||||||
Reference in New Issue
Block a user