fix
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import bson
|
||||
import datetime
|
||||
import pydantic
|
||||
import typing
|
||||
|
||||
from app.storage.mongo import database
|
||||
from app.utils import time
|
||||
@@ -27,7 +26,7 @@ async def add_task(task: Task) -> str:
|
||||
return result.inserted_id
|
||||
|
||||
|
||||
async def take_task(queue: str) -> typing.Optional[Task]:
|
||||
async def take_task(queue: str) -> Task|None:
|
||||
now = time.now()
|
||||
async for raw_task in collection.find({'queue': queue, 'available_from': {'$lte': now}}):
|
||||
task = Task.model_validate(raw_task)
|
||||
|
||||
Reference in New Issue
Block a user