fix
This commit is contained in:
@@ -17,8 +17,7 @@ class Response(pydantic.BaseModel):
|
||||
|
||||
@router.get('/api/v1/take', responses={404: {'description': 'Not found'}})
|
||||
async def execute(queue: typing.Annotated[str, fastapi.Header()]) -> Response:
|
||||
async with redis.database.lock(queue):
|
||||
task = await tasks.take_task(queue)
|
||||
task = await tasks.take_task(queue)
|
||||
if not task:
|
||||
raise fastapi.HTTPException(404)
|
||||
return Response(id=str(task._id), attempt=task.attempts, payload=task.payload)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import os
|
||||
import redis.asyncio as connection
|
||||
|
||||
|
||||
REDIS_HOST = os.getenv('REDIS_HOST', 'localhost')
|
||||
REDIS_PASSWORD = os.getenv('REDIS_PASSWORD')
|
||||
|
||||
|
||||
database = connection.Redis(host=REDIS_HOST, password=REDIS_PASSWORD)
|
||||
Reference in New Issue
Block a user