mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-12 21:48:35 +03:00
redis fixes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,5 +8,6 @@ __pycache
|
|||||||
.pytest_cach
|
.pytest_cach
|
||||||
.env
|
.env
|
||||||
*.db
|
*.db
|
||||||
|
redis/data/*
|
||||||
#temp
|
#temp
|
||||||
tests
|
tests
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ services:
|
|||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:6-alpine
|
image: redis:6-alpine
|
||||||
|
command: redis-server /conf/redis.conf
|
||||||
|
volumes:
|
||||||
|
- "./redis/data:/data"
|
||||||
|
- "./redis/config:/conf"
|
||||||
restart: always
|
restart: always
|
||||||
# DEV ONLY
|
# DEV ONLY
|
||||||
ports:
|
ports:
|
||||||
@@ -39,7 +43,7 @@ services:
|
|||||||
dashboard:
|
dashboard:
|
||||||
build: ./src
|
build: ./src
|
||||||
restart: always
|
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:
|
ports:
|
||||||
- 5556:5555
|
- 5556:5555
|
||||||
environment:
|
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
|
"task_result": task_result.result
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
json_result = jsonable_encoder(result)
|
json_result = jsonable_encoder(result, exclude_unset=True)
|
||||||
# json_result = jsonable_encoder(result, custom_encoder=pydantic_encoder) # causes error
|
# json_result = jsonable_encoder(result, custom_encoder={"pydantic_encoder": pydantic_encoder}) # causes error
|
||||||
return JSONResponse(json_result)
|
return JSONResponse(json_result)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
@@ -75,7 +75,7 @@ def get_status(task_id, access_token:str):
|
|||||||
|
|
||||||
@app.get("/")
|
@app.get("/")
|
||||||
def home():
|
def home():
|
||||||
return JSONResponse({"message": "Hello"})
|
return JSONResponse({"status": "good", "version": "0.1.0"})
|
||||||
|
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
async def on_startup():
|
async def on_startup():
|
||||||
|
|||||||
Reference in New Issue
Block a user