From 606a6fcffc4c8b3a556ea5fedf1089af34842bae Mon Sep 17 00:00:00 2001 From: Chris Khan Date: Sat, 31 Dec 2022 01:56:45 -0800 Subject: [PATCH] Logging to debug file copy --- cdp_backend/pipeline/event_gather_pipeline.py | 7 ++++--- cdp_backend/utils/file_utils.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cdp_backend/pipeline/event_gather_pipeline.py b/cdp_backend/pipeline/event_gather_pipeline.py index 04dbfc63..042d441c 100644 --- a/cdp_backend/pipeline/event_gather_pipeline.py +++ b/cdp_backend/pipeline/event_gather_pipeline.py @@ -334,9 +334,10 @@ def convert_video_and_handle_host( trim_video = bool(session.video_start_time or session.video_end_time) - log.info(f"File to trim: {str(video_filepath)}") - log.info(f"File exists: {video_filepath.exists()}") - log.info(f"File stats: {video_filepath.stat()}") + log.info(f"File to trim: {video_filepath}") + log.info(f"File exists: {Path(video_filepath).exists()}") + if Path(video_filepath).exists(): + log.info(f"File stats: {Path(video_filepath).stat()}") # Convert to mp4 if file isn't of approved web format cdp_will_host = False diff --git a/cdp_backend/utils/file_utils.py b/cdp_backend/utils/file_utils.py index cecf4dcf..042a7cbb 100644 --- a/cdp_backend/utils/file_utils.py +++ b/cdp_backend/utils/file_utils.py @@ -717,7 +717,8 @@ def clip_and_reformat_video( log.info(f"File to trim: {str(video_filepath)}") log.info(f"File exists: {video_filepath.exists()}") - log.info(f"File stats: {video_filepath.stat()}") + if video_filepath.exists(): + log.info(f"File stats: {video_filepath.stat()}") try: ffmpeg_stdout, ffmpeg_stderr = (