RefreshStatus loads the latest chat status and publishes it to stream subscribers.
(ctx context.Context, chatID uuid.UUID)
| 3844 | |
| 3845 | // RefreshStatus loads the latest chat status and publishes it to stream subscribers. |
| 3846 | func (p *Server) RefreshStatus(ctx context.Context, chatID uuid.UUID) error { |
| 3847 | if chatID == uuid.Nil { |
| 3848 | return xerrors.New("chat_id is required") |
| 3849 | } |
| 3850 | |
| 3851 | chat, err := p.db.GetChatByID(ctx, chatID) |
| 3852 | if err != nil { |
| 3853 | return xerrors.Errorf("get chat: %w", err) |
| 3854 | } |
| 3855 | |
| 3856 | p.publishStatus(chat.ID, chat.Status, chat.WorkerID) |
| 3857 | return nil |
| 3858 | } |
| 3859 | |
| 3860 | func (p *Server) setChatWaiting(ctx context.Context, chatID uuid.UUID) (database.Chat, error) { |
| 3861 | var updatedChat database.Chat |
nothing calls this directly
no test coverage detected