reduced redis access count
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-12-11 00:08:17 +01:00
parent f6d36a9f87
commit ba8718054b

View File

@ -66,9 +66,10 @@ class AssignmentView(FlaskView):
if default_target: if default_target:
target_site = default_target target_site = default_target
redis_client.set(schedule_store_key, default_target) redis_client.set(schedule_store_key, default_target, ex=current_app.config['DEVICE_TIMEOUT'])
# Update (or set) TTL else:
# Just Update TTL
redis_client.expire( redis_client.expire(
schedule_store_key, schedule_store_key,
current_app.config['DEVICE_TIMEOUT'] current_app.config['DEVICE_TIMEOUT']