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

Function updateChatStatusPreserveUpdatedAt

coderd/x/chatd/chatd.go:2951–2971  ·  view source on GitHub ↗

updateChatStatusPreserveUpdatedAt applies internal lock transitions without changing chat recency, because chat list ordering uses updated_at.

(
	ctx context.Context,
	store database.Store,
	chat database.Chat,
	workerID uuid.NullUUID,
	startedAt sql.NullTime,
	heartbeatAt sql.NullTime,
)

Source from the content-addressed store, hash-verified

2949// updateChatStatusPreserveUpdatedAt applies internal lock transitions without
2950// changing chat recency, because chat list ordering uses updated_at.
2951func updateChatStatusPreserveUpdatedAt(
2952 ctx context.Context,
2953 store database.Store,
2954 chat database.Chat,
2955 workerID uuid.NullUUID,
2956 startedAt sql.NullTime,
2957 heartbeatAt sql.NullTime,
2958) (database.Chat, error) {
2959 return store.UpdateChatStatusPreserveUpdatedAt(
2960 ctx,
2961 database.UpdateChatStatusPreserveUpdatedAtParams{
2962 ID: chat.ID,
2963 Status: chat.Status,
2964 WorkerID: workerID,
2965 StartedAt: startedAt,
2966 HeartbeatAt: heartbeatAt,
2967 LastError: chat.LastError,
2968 UpdatedAt: chat.UpdatedAt,
2969 },
2970 )
2971}
2972
2973func (p *Server) acquireManualTitleLock(ctx context.Context, chatID uuid.UUID) error {
2974 now := time.Now()

Callers 2

Tested by

no test coverage detected