mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-08 03:28:35 +03:00
redis fixes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,5 +8,6 @@ __pycache
|
||||
.pytest_cach
|
||||
.env
|
||||
*.db
|
||||
redis/data/*
|
||||
#temp
|
||||
tests
|
||||
|
||||
@@ -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
0
redis/config/.gitkeep
Normal file
0
redis/config/redis.conf
Normal file
0
redis/config/redis.conf
Normal 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():
|
||||
|
||||
Reference in New Issue
Block a user