redis fixes

This commit is contained in:
msramalho
2023-02-25 13:19:42 +01:00
parent 570c0c2abe
commit 6b4dd9c0a9
5 changed files with 9 additions and 4 deletions

1
.gitignore vendored
View File

@@ -8,5 +8,6 @@ __pycache
.pytest_cach
.env
*.db
redis/data/*
#temp
tests

View File

@@ -31,6 +31,10 @@ services:
redis:
image: redis:6-alpine
command: redis-server /conf/redis.conf
volumes:
- "./redis/data:/data"
- "./redis/config:/conf"
restart: always
# DEV ONLY
ports:
@@ -39,7 +43,7 @@ services:
dashboard:
build: ./src
restart: always
command: flower --app=worker.celery --port=5555 --broker=redis://redis:6379/0
command: flower --app=worker.celery --port=5555 --broker=redis://redis:6379/0 --basic_auth=${FLOWER_USERNAME}:${FLOWER_PASSWORD}
ports:
- 5556:5555
environment:

0
redis/config/.gitkeep Normal file
View File

0
redis/config/redis.conf Normal file
View File

View File

@@ -58,8 +58,8 @@ def get_status(task_id, access_token:str):
"task_result": task_result.result
}
try:
json_result = jsonable_encoder(result)
# json_result = jsonable_encoder(result, custom_encoder=pydantic_encoder) # causes error
json_result = jsonable_encoder(result, exclude_unset=True)
# json_result = jsonable_encoder(result, custom_encoder={"pydantic_encoder": pydantic_encoder}) # causes error
return JSONResponse(json_result)
except Exception as e:
logger.error(e)
@@ -75,7 +75,7 @@ def get_status(task_id, access_token:str):
@app.get("/")
def home():
return JSONResponse({"message": "Hello"})
return JSONResponse({"status": "good", "version": "0.1.0"})
@app.on_event("startup")
async def on_startup():