MCPcopy Create free account
hub / github.com/atripati/ark / SavePattern

Method SavePattern

pkg/store/store.go:194–202  ·  view source on GitHub ↗
(record QueryPatternRecord)

Source from the content-addressed store, hash-verified

192}
193
194func (s *JSONFileStore) SavePattern(record QueryPatternRecord) error {
195 select {
196 case s.writeCh <- writeOp{pattern: &record}:
197 return nil
198 case <-time.After(100 * time.Millisecond):
199 s.logger.Printf("write timeout, dropping pattern %s", record.Pattern)
200 return fmt.Errorf("ark/store: write timeout")
201 }
202}
203func (s *JSONFileStore) LoadAll() ([]ToolStatsRecord, error) {
204 s.mu.RLock()
205 defer s.mu.RUnlock()

Callers 1

TestStorePatternSnapshotFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestStorePatternSnapshotFunction · 0.76