Properly handle errors when saving updated file doc after Zencoder notif.

We never checked the return values from the put_internal() call, so errors
would have passed silently into the night.
This commit is contained in:
2018-01-26 12:49:15 +01:00
parent 89ca0516a9
commit f8c3408f18
2 changed files with 76 additions and 1 deletions

View File

@@ -168,7 +168,10 @@ def zencoder_notifications():
# Force an update of the links on the next load of the file.
file_doc['link_expires'] = datetime.datetime.now(tz=tz_util.utc) - datetime.timedelta(days=1)
current_app.put_internal('files', file_doc, _id=file_id)
r, _, _, status = current_app.put_internal('files', file_doc, _id=file_id)
if status != 200:
log.error('unable to save file %s after Zencoder notification: %s', file_id, r)
return json.dumps(r), 500
return '', 204