MCPcopy Index your code
hub / github.com/coder/coder / RefreshStatus

Method RefreshStatus

coderd/x/chatd/chatd.go:3846–3858  ·  view source on GitHub ↗

RefreshStatus loads the latest chat status and publishes it to stream subscribers.

(ctx context.Context, chatID uuid.UUID)

Source from the content-addressed store, hash-verified

3844
3845// RefreshStatus loads the latest chat status and publishes it to stream subscribers.
3846func (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
3860func (p *Server) setChatWaiting(ctx context.Context, chatID uuid.UUID) (database.Chat, error) {
3861 var updatedChat database.Chat

Callers

nothing calls this directly

Calls 4

publishStatusMethod · 0.95
NewMethod · 0.65
GetChatByIDMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected