mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-26 14:01:30 +00:00
refactor(backups): remove extraneous asserts from jobs
This commit is contained in:
parent
c8512eacdc
commit
c5c41b3ced
|
@ -134,8 +134,6 @@ class Jobs:
|
||||||
def log_status_update(job: Job, status: JobStatus):
|
def log_status_update(job: Job, status: JobStatus):
|
||||||
redis = RedisPool().get_connection()
|
redis = RedisPool().get_connection()
|
||||||
key = _status_log_key_from_uuid(job.uid)
|
key = _status_log_key_from_uuid(job.uid)
|
||||||
if redis.exists(key):
|
|
||||||
assert redis.type(key) == "list"
|
|
||||||
redis.lpush(key, status.value)
|
redis.lpush(key, status.value)
|
||||||
redis.expire(key, 10)
|
redis.expire(key, 10)
|
||||||
|
|
||||||
|
@ -143,8 +141,6 @@ class Jobs:
|
||||||
def log_progress_update(job: Job, progress: int):
|
def log_progress_update(job: Job, progress: int):
|
||||||
redis = RedisPool().get_connection()
|
redis = RedisPool().get_connection()
|
||||||
key = _progress_log_key_from_uuid(job.uid)
|
key = _progress_log_key_from_uuid(job.uid)
|
||||||
if redis.exists(key):
|
|
||||||
assert redis.type(key) == "list"
|
|
||||||
redis.lpush(key, progress)
|
redis.lpush(key, progress)
|
||||||
redis.expire(key, 10)
|
redis.expire(key, 10)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue