chore(backend): upgrade deps and remove redis/rq
This commit is contained in:
@@ -25,7 +25,6 @@ class Settings(BaseSettings):
|
||||
|
||||
environment: str = "dev"
|
||||
database_url: str = "postgresql+psycopg://postgres:postgres@localhost:5432/openclaw_agency"
|
||||
redis_url: str = "redis://localhost:6379/0"
|
||||
|
||||
# Clerk auth (auth only; roles stored in DB)
|
||||
clerk_secret_key: str = Field(min_length=1)
|
||||
|
||||
@@ -35,7 +35,7 @@ class GatewayConfig:
|
||||
|
||||
|
||||
def _build_gateway_url(config: GatewayConfig) -> str:
|
||||
base_url = (config.url or "").strip()
|
||||
base_url: str = (config.url or "").strip()
|
||||
if not base_url:
|
||||
message = "Gateway URL is not configured for this board."
|
||||
raise OpenClawGatewayError(message)
|
||||
@@ -44,11 +44,11 @@ def _build_gateway_url(config: GatewayConfig) -> str:
|
||||
return base_url
|
||||
parsed = urlparse(base_url)
|
||||
query = urlencode({"token": token})
|
||||
return urlunparse(parsed._replace(query=query))
|
||||
return str(urlunparse(parsed._replace(query=query)))
|
||||
|
||||
|
||||
async def _await_response(
|
||||
ws: websockets.WebSocketClientProtocol,
|
||||
ws: websockets.ClientConnection,
|
||||
request_id: str,
|
||||
) -> object:
|
||||
while True:
|
||||
@@ -70,7 +70,7 @@ async def _await_response(
|
||||
|
||||
|
||||
async def _send_request(
|
||||
ws: websockets.WebSocketClientProtocol,
|
||||
ws: websockets.ClientConnection,
|
||||
method: str,
|
||||
params: dict[str, Any] | None,
|
||||
) -> object:
|
||||
@@ -102,7 +102,7 @@ def _build_connect_params(config: GatewayConfig) -> dict[str, Any]:
|
||||
|
||||
|
||||
async def _ensure_connected(
|
||||
ws: websockets.WebSocketClientProtocol,
|
||||
ws: websockets.ClientConnection,
|
||||
first_message: str | bytes | None,
|
||||
config: GatewayConfig,
|
||||
) -> None:
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
"""RQ queue and Redis connection helpers for background workers."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from redis import Redis
|
||||
from rq import Queue
|
||||
|
||||
from app.core.config import settings
|
||||
|
||||
|
||||
def get_redis() -> Redis:
|
||||
"""Create a Redis client from configured settings."""
|
||||
return Redis.from_url(settings.redis_url)
|
||||
|
||||
|
||||
def get_queue(name: str) -> Queue:
|
||||
"""Return an RQ queue bound to the configured Redis connection."""
|
||||
return Queue(name, connection=get_redis())
|
||||
Reference in New Issue
Block a user