Skip to content

Commit 9ea040e

Browse files
committed
updated
1 parent 2d8a549 commit 9ea040e

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

app/main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
sanitize_filename,
3636
)
3737

38+
39+
class SentinelVideoProcessingError(Exception):
40+
"""Raised when Sentinel video processing fails before file relocation."""
41+
3842
# --- WebSocket Manager ---
3943
class ConnectionManager:
4044
def __init__(self):
@@ -359,7 +363,8 @@ async def sentinel_loop():
359363
try:
360364
initial_size = file_path.stat().st_size
361365
await asyncio.sleep(1)
362-
if not file_path.exists(): continue
366+
if not file_path.exists():
367+
continue
363368
final_size = file_path.stat().st_size
364369
if initial_size != final_size:
365370
continue # Still writing
@@ -421,7 +426,7 @@ async def sentinel_loop():
421426
if success:
422427
processed_path = Path(out_path) if out_path else None
423428
else:
424-
raise Exception(msg)
429+
raise SentinelVideoProcessingError(msg)
425430

426431
# Move original to sentinel-mode/originals
427432
dest_original = _build_unique_destination(sentinel_originals_dir, file_path.name)

0 commit comments

Comments
 (0)