diff --git a/pkg/database/querycache/event_cache.go b/pkg/database/querycache/event_cache.go index 4b37e8c..43b0ce9 100644 --- a/pkg/database/querycache/event_cache.go +++ b/pkg/database/querycache/event_cache.go @@ -99,6 +99,8 @@ func NewEventCache(maxSize int64, maxAge time.Duration) *EventCache { // Get retrieves cached serialized events for a filter (decompresses on the fly) func (c *EventCache) Get(f *filter.F) (serializedJSON [][]byte, found bool) { + // Normalize filter by sorting to ensure consistent cache keys + f.Sort() filterKey := string(f.Serialize()) c.mu.RLock() @@ -173,6 +175,8 @@ func (c *EventCache) PutJSON(f *filter.F, marshaledJSON [][]byte) { return } + // Normalize filter by sorting to ensure consistent cache keys + f.Sort() filterKey := string(f.Serialize()) // Concatenate all JSON events with newline delimiters for compression diff --git a/pkg/dgraph/dgraph.go b/pkg/dgraph/dgraph.go index efe90be..8eaa93e 100644 --- a/pkg/dgraph/dgraph.go +++ b/pkg/dgraph/dgraph.go @@ -284,6 +284,6 @@ func (d *D) warmup() { // Just give a brief moment for any background processes to settle d.Logger.Infof("dgraph database warmup complete, ready to serve requests") } -func (d *D) GetCachedJSON(f *filter.F) ([][]byte, bool) { return nil, false } -func (d *D) CacheMarshaledJSON(f *filter.F, marshaledJSON [][]byte) {} -func (d *D) InvalidateQueryCache() {} +func (d *D) GetCachedJSON(f *filter.F) ([][]byte, bool) { return nil, false } +func (d *D) CacheMarshaledJSON(f *filter.F, marshaledJSON [][]byte) {} +func (d *D) InvalidateQueryCache() {} diff --git a/pkg/version/version b/pkg/version/version index 5bc2965..9f27816 100644 --- a/pkg/version/version +++ b/pkg/version/version @@ -1 +1 @@ -v0.29.0 \ No newline at end of file +v0.29.2 \ No newline at end of file