minor fixes

This commit is contained in:
2023-09-26 16:32:36 +03:00
committed by nikili0n
parent 82a951f715
commit fd874b4cd8
3 changed files with 10 additions and 2 deletions

View File

@ -42,6 +42,7 @@ class MasterService:
while True:
video_params = await self.queue.get()
redis = RedisClient()
await redis.del_tasks_queue()
await redis.del_task_from_queue_and_add_to_tasks(task=video_params)
self.currently_underway[video_params['link']] = video_params

View File

@ -60,3 +60,8 @@ class RedisClient:
async with self.connection as connection:
res = await connection.srem(self.TASKS_DONE_NAME + f":1", json.dumps(task, indent=4).encode('utf-8'))
return res
async def del_tasks_queue(self) -> int:
async with self.connection as connection:
res = await connection.delete(self.TASKS_NAME + f":1")
return res