refactor: update UserSlashCommand relationship and improve healthcheck command in docker-compose

This commit is contained in:
2026-06-15 19:31:59 +08:00
parent 96334ce97a
commit 34af8bc54d
2 changed files with 3 additions and 6 deletions
+2 -5
View File
@@ -10,15 +10,12 @@ The unique ``(user_id, name)`` constraint prevents a user from shadowing a
built-in's name with a custom command of the same name.
"""
from __future__ import annotations
import uuid
from typing import TYPE_CHECKING
from sqlalchemy import Boolean, Column, ForeignKey, Text, UniqueConstraint
from sqlalchemy.dialects.postgresql import UUID as PG_UUID
from sqlalchemy.orm import relationship
from sqlmodel import Field, SQLModel
from sqlmodel import Field, Relationship, SQLModel
from app.db.base import TimestampMixin
@@ -48,7 +45,7 @@ class UserSlashCommand(TimestampMixin, SQLModel, table=True):
prompt: str | None = Field(default=None, sa_column=Column(Text, nullable=True))
is_enabled: bool = Field(default=True, sa_column=Column(Boolean, nullable=False, default=True))
user: User = relationship("User", lazy="joined")
user: "User" = Relationship(sa_relationship_kwargs={"lazy": "joined"})
def __repr__(self) -> str:
kind = "custom" if self.prompt is not None else "builtin-override"
+1 -1
View File
@@ -88,7 +88,7 @@ services:
networks:
- backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6333/healthz"]
test: bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1
interval: 10s
timeout: 5s
retries: 5