(record QueryPatternRecord)
| 192 | } |
| 193 | |
| 194 | func (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 | } |
| 203 | func (s *JSONFileStore) LoadAll() ([]ToolStatsRecord, error) { |
| 204 | s.mu.RLock() |
| 205 | defer s.mu.RUnlock() |
no outgoing calls