From 32bf986d15201d9bbab7e24f2c4a7681db8a9f5a Mon Sep 17 00:00:00 2001 From: Yibo Wei Date: Wed, 29 May 2024 14:54:05 -0700 Subject: [PATCH] Add Redis Queue Dashboard to Phone Sensors API --- phone_sensors/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phone_sensors/api.py b/phone_sensors/api.py index 3c39e73..c8c56a3 100644 --- a/phone_sensors/api.py +++ b/phone_sensors/api.py @@ -8,12 +8,16 @@ from fastapi import Depends, FastAPI, Form, HTTPException, UploadFile from fastapi.responses import RedirectResponse from redis import Redis +from rq_dashboard_fast import RedisQueueDashboard from phone_sensors.birdnet import submit_analyze_audio_job from phone_sensors.schemas import SensorStatus from phone_sensors.settings import get_db_session, get_redis_connection app = FastAPI(title="Phone Sensors API", version="0.1.0") +dashboard = RedisQueueDashboard("redis://redis:6379/", "/rq") + +app.mount("/rq", dashboard) @app.get("/")