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

Method dispatchPush

coderd/x/chatd/chatd.go:9846–9866  ·  view source on GitHub ↗
(
	ctx context.Context,
	chat database.Chat,
	body string,
	status database.ChatStatus,
	logger slog.Logger,
)

Source from the content-addressed store, hash-verified

9844}
9845
9846func (p *Server) dispatchPush(
9847 ctx context.Context,
9848 chat database.Chat,
9849 body string,
9850 status database.ChatStatus,
9851 logger slog.Logger,
9852) {
9853 pushMsg := codersdk.WebpushMessage{
9854 Title: chat.Title,
9855 Body: body,
9856 Icon: "/favicon.ico",
9857 Data: map[string]string{"url": fmt.Sprintf("/agents/%s", chat.ID)},
9858 }
9859 if err := p.webpushDispatcher.Dispatch(ctx, chat.OwnerID, pushMsg); err != nil {
9860 logger.Warn(ctx, "failed to send chat completion web push",
9861 slog.F("chat_id", chat.ID),
9862 slog.F("status", status),
9863 slog.Error(err),
9864 )
9865 }
9866}
9867
9868// Close stops the processor and waits for it to finish.
9869func (p *Server) Close() error {

Calls 2

DispatchMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected