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

Method upsertChatDiffStatusReference

coderd/exp_chats.go:4205–4230  ·  view source on GitHub ↗
(
	ctx context.Context,
	chatID uuid.UUID,
	pullRequestURL string,
	staleAt time.Time,
)

Source from the content-addressed store, hash-verified

4203}
4204
4205func (api *API) upsertChatDiffStatusReference(
4206 ctx context.Context,
4207 chatID uuid.UUID,
4208 pullRequestURL string,
4209 staleAt time.Time,
4210) (database.ChatDiffStatus, error) {
4211 status, err := api.Database.UpsertChatDiffStatusReference(
4212 ctx,
4213 database.UpsertChatDiffStatusReferenceParams{
4214 ChatID: chatID,
4215 Url: sql.NullString{
4216 String: pullRequestURL,
4217 Valid: strings.TrimSpace(pullRequestURL) != "",
4218 },
4219 // Empty strings preserve existing values via the
4220 // CASE expression in the SQL query.
4221 GitBranch: "",
4222 GitRemoteOrigin: "",
4223 StaleAt: staleAt,
4224 },
4225 )
4226 if err != nil {
4227 return database.ChatDiffStatus{}, xerrors.Errorf("upsert chat diff status reference: %w", err)
4228 }
4229 return status, nil
4230}
4231
4232func (api *API) getCachedChatDiffStatus(
4233 ctx context.Context,

Callers 1

Calls 2

ErrorfMethod · 0.45

Tested by

no test coverage detected