Feat: bot failed state to show/hide llm restart btn

This commit is contained in:
Grail Finder
2025-07-13 08:31:16 +03:00
parent 757586ea22
commit 155aa1b2cb
6 changed files with 27 additions and 13 deletions

View File

@ -15,6 +15,20 @@ type RoomsRepo interface {
RoomCreate(ctx context.Context, room *models.Room) error
RoomDeleteByID(ctx context.Context, id string) error
RoomUpdate(ctx context.Context, room *models.Room) error
RoomSetBotFailed(ctx context.Context, roomID string) error
RoomUnSetBotFailed(ctx context.Context, roomID string) error
}
func (p *RepoProvider) RoomSetBotFailed(ctx context.Context, roomID string) error {
db := getDB(ctx, p.DB)
_, err := db.ExecContext(ctx, "UPDATE rooms SET bot_failed = true WHERE id = ?", roomID)
return err
}
func (p *RepoProvider) RoomUnSetBotFailed(ctx context.Context, roomID string) error {
db := getDB(ctx, p.DB)
_, err := db.ExecContext(ctx, "UPDATE rooms SET bot_failed = false WHERE id = ?", roomID)
return err
}
func (p *RepoProvider) RoomList(ctx context.Context) ([]*models.Room, error) {