From 1cb4d413341a44c6a75f0031c5fddcd87eb0be60 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sun, 3 Nov 2019 07:03:36 -0800 Subject: [PATCH] cutter: Set upload time when marking video as done without transcoding --- cutter/cutter/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cutter/cutter/main.py b/cutter/cutter/main.py index 9de06d1..83553c5 100644 --- a/cutter/cutter/main.py +++ b/cutter/cutter/main.py @@ -444,7 +444,8 @@ class Cutter(object): # Success! Set TRANSCODING or DONE and clear any previous error. success_state = 'TRANSCODING' if upload_backend.needs_transcode else 'DONE' - set_row(state=success_state, video_id=video_id, video_link=video_link, error=None) + maybe_upload_time = {"upload_time": datetime.datetime.utcnow()} if success_state == 'DONE' else {} + set_row(state=success_state, video_id=video_id, video_link=video_link, error=None, **maybe_upload_time) self.logger.info("Successfully cut and uploaded job {} as {}".format(format_job(job), video_link)) videos_uploaded.labels(video_channel=job.video_channel,