up fix to sitenotimplementedexception
This commit is contained in:
@ -45,13 +45,29 @@ app.add_middleware(
|
||||
TypeError: string indices must be integers
|
||||
'''
|
||||
|
||||
'''
|
||||
queue_name -> [
|
||||
"{link...}",
|
||||
"{link2...}",
|
||||
"{link3..}"
|
||||
]
|
||||
|
||||
queue_name -> {
|
||||
"link1" -> {vars},
|
||||
"link2" -> {vars},
|
||||
"link3" -> {vars},
|
||||
}
|
||||
'''
|
||||
|
||||
|
||||
async def is_task_already_done_or_exist(redis: RedisClient, link: str):
|
||||
messages = await redis.get_task_done_queue()
|
||||
|
||||
temp = [json.loads(msg) for msg in messages]
|
||||
print(temp)
|
||||
tasks = [
|
||||
literal_eval(message.decode('utf-8')) for message in messages
|
||||
if literal_eval(message.decode('utf-8'))["link"] == link
|
||||
and literal_eval(message.decode('utf-8'))["status"] in ["done", "exist"]
|
||||
msg for msg in temp
|
||||
if msg["link"] == link
|
||||
and msg["status"] in ["done", "exist"]
|
||||
]
|
||||
|
||||
if len(tasks) > 0:
|
||||
|
Reference in New Issue
Block a user