After Zencoder has finished, force update of the links on next file request.

This commit is contained in:
Sybren A. Stüvel 2016-05-27 16:32:52 +02:00
parent dd90fafad4
commit 23946b1e3a

View File

@ -1,7 +1,9 @@
import logging import logging
import datetime
import os import os
from bson import ObjectId from bson import ObjectId, tz_util
from eve.methods.put import put_internal from eve.methods.put import put_internal
from flask import Blueprint from flask import Blueprint
from flask import abort from flask import abort
@ -165,6 +167,10 @@ def zencoder_notifications():
}) })
file_doc['status'] = 'complete' file_doc['status'] = 'complete'
# 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)
put_internal('files', file_doc, _id=file_id) put_internal('files', file_doc, _id=file_id)
return '', 204 return '', 204