Skip to content

Commit

Permalink
more specific way to check for video file exists for queue
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsridhar12345 committed May 4, 2024
1 parent ba3576c commit a1c64cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/npc_lims/jobs/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,19 @@ def add_sessions_to_queue(
) -> None:
for session_info in npc_lims.get_session_info(is_ephys=True, is_uploaded=True):
if (
hasattr(session_info, f"is_{process_name}")
and
getattr(session_info, f"is_{process_name}")
and not overwrite_exisitng_assets
): # asset exists already
continue

# if video capsule to run and surface recording gets uploaded first, no video so skip
if process_name in VIDEO_MODELS and not session_info.is_video:
continue
if process_name in VIDEO_MODELS:
try:
s3.get_behavior_video_path_from_s3(session_info.id) # check if there is a video on s3
except FileNotFoundError:
continue

session_id = session_info.id
add_to_queue(session_id, process_name)
Expand Down

0 comments on commit a1c64cb

Please sign in to comment.