Skip to content

Commit

Permalink
queue output for ondeck script
Browse files Browse the repository at this point in the history
  • Loading branch information
efultz committed Jul 28, 2023
1 parent 7b79a38 commit 1801ad0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion run_ondeck.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def run_ondeck(output_dir: Path, engine: Path, sessionmaker: SessionMaker, thalo
@click.option('--output_dir', default=flaskconfig.get('VIDEO_OUTPUT_DIR'))
@click.option('--engine', default=flaskconfig.get('ONDECK_MODEL_ENGINE'))
@click.option('--thalos_cam_name', default=flaskconfig.get('THALOS_CAM_NAME'))
def main(dbname, dbuser, output_dir, engine, thalos_cam_name):
@click.option('--print_queue', is_flag=True)
def main(dbname, dbuser, output_dir, engine, thalos_cam_name, print_queue):

output_dir = Path(output_dir)

Expand All @@ -123,6 +124,13 @@ def main(dbname, dbuser, output_dir, engine, thalos_cam_name):

ModelBase.metadata.create_all(sa_engine)

if print_queue:
with sessionmaker() as session:
video_files = next_videos(session, thalos_cam_name)
for v in video_files:
print(v.decrypted_path)
return

def runonce(output_dir, engine, sessionmaker, thalos_cam_name):
run_ondeck(output_dir, engine, sessionmaker, thalos_cam_name)
return schedule.CancelJob
Expand Down

0 comments on commit 1801ad0

Please sign in to comment.