MCPcopy Create free account
hub / github.com/InferCore/InferCore / UpdateRequest

Method UpdateRequest

internal/requests/memory.go:35–59  ·  view source on GitHub ↗
(_ context.Context, requestID string, patch RequestPatch)

Source from the content-addressed store, hash-verified

33}
34
35func (m *memoryStore) UpdateRequest(_ context.Context, requestID string, patch RequestPatch) error {
36 m.mu.Lock()
37 defer m.mu.Unlock()
38 r, ok := m.requests[requestID]
39 if !ok {
40 return ErrNotFound
41 }
42 if patch.Status != nil {
43 r.Status = *patch.Status
44 }
45 if patch.SelectedBackend != nil {
46 r.SelectedBackend = *patch.SelectedBackend
47 }
48 if patch.RouteReason != nil {
49 r.RouteReason = *patch.RouteReason
50 }
51 if patch.PolicySnapshot != nil {
52 r.PolicySnapshot = append([]byte(nil), patch.PolicySnapshot...)
53 }
54 if !patch.UpdatedAt.IsZero() {
55 r.UpdatedAt = patch.UpdatedAt
56 }
57 m.requests[requestID] = r
58 return nil
59}
60
61func (m *memoryStore) AppendStep(_ context.Context, step StepRow) error {
62 m.mu.Lock()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected