e1250 commited on
Commit
75be613
·
1 Parent(s): d6b54f6

feat: stream redis on upstash

Browse files
Files changed (4) hide show
  1. config/.env.example +1 -0
  2. config/settings.py +1 -0
  3. main.py +1 -1
  4. requirements.txt +1 -0
config/.env.example CHANGED
@@ -0,0 +1 @@
 
 
1
+ redis_url=
config/settings.py CHANGED
@@ -74,6 +74,7 @@ class AppConfig(BaseSettings):
74
  security_detector: SecurityDetector
75
  depth: DepthConfig
76
  intervals: IntervalsConfig
 
77
 
78
  # Backend
79
 
 
74
  security_detector: SecurityDetector
75
  depth: DepthConfig
76
  intervals: IntervalsConfig
77
+ redis_url:str
78
 
79
  # Backend
80
 
main.py CHANGED
@@ -44,7 +44,7 @@ async def lifespan(app: FastAPI):
44
  # app.state.camera_metadata = {}
45
  # app.state.dashboard_clients = set()
46
  # Redis(host="localhost", port=6379, db=0, decode_responses=True)
47
- app.state.redis = aioredis.from_url("redis://localhost:6379", db=0, decode_responses=True)
48
  # Cnecking connection to redis.
49
  # Thinking of moving this to the health check.
50
  try:
 
44
  # app.state.camera_metadata = {}
45
  # app.state.dashboard_clients = set()
46
  # Redis(host="localhost", port=6379, db=0, decode_responses=True)
47
+ app.state.redis = aioredis.from_url(settings.redis_url, decode_responses=True)
48
  # Cnecking connection to redis.
49
  # Thinking of moving this to the health check.
50
  try:
requirements.txt CHANGED
@@ -11,6 +11,7 @@ structlog
11
  tracking_system@git+https://github.com/E1250/p-tracking_system.git@main
12
 
13
  redis
 
14
  prometheus_client
15
 
16
  numpy
 
11
  tracking_system@git+https://github.com/E1250/p-tracking_system.git@main
12
 
13
  redis
14
+ upstash_redis
15
  prometheus_client
16
 
17
  numpy