Verified Commit 59834d45 authored by Huste, Tobias (FWCC) - 111645's avatar Huste, Tobias (FWCC) - 111645
Browse files

api: set configurable ttl for redis job id storage

parent f76cfd61
Pipeline #6566 passed with stages
in 17 minutes and 20 seconds
......@@ -156,7 +156,10 @@ class UploadByUrl(ContentNegotiatedMethodView):
except KeyError:
id_list = [str(celery_id)]
data = json.dumps(id_list).encode('utf-8')
_redisstore.put(key, data)
_redisstore.put(
key, data,
ttl_secs=current_app.config['UPLOADBYURL_REDIS_KEY_TTL']
)
response = jsonify(
celery_id=str(celery_id),
message='Started file upload in background.',
......
......@@ -88,3 +88,6 @@ UPLOADBYURL_EMAIL_BODY_FAILED_URL = 'Your upload failed. The file could ' \
UPLOADBYURL_REMOTE_SERVERS = {}
"""Special configuration option for remote server."""
UPLOADBYURL_REDIS_KEY_TTL = 7 * 24 * 3600
"""Time-To-Live value in seconds for the job ids stored in Redis."""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment