mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 20:11:54 +00:00
Relates to #64041 This refactors the `adminanalytics` package to set the cache explicitly instead of implicitly relying on the global `redispool.Store`. The global store obfuscated the dependency and also made testing a bit awkward. Test plan: - new unit test - I ran a local instance and checked for panics in the logs from the worker job that updates the cache on startup. - Checked that the following GQL query returned results ```GQL query { site { analytics { search(dateRange: LAST_MONTH, grouping: WEEKLY) { searches { nodes { date count } summary { totalCount totalUniqueUsers totalRegisteredUsers } } } } } } ``` - I deleted the cache and ran the GQL query again and verified that cache had the following new entries ``` 1) "adminanalytics:Search:Searches:LAST_MONTH:WEEKLY:nodes" 2) "adminanalytics:Search:Searches:LAST_MONTH:WEEKLY:summary" ``` |
||
|---|---|---|
| .. | ||
| batchchanges.go | ||
| BUILD.bazel | ||
| cache_test.go | ||
| cache.go | ||
| codeinsights.go | ||
| codeintel.go | ||
| codeintelbylanguage.go | ||
| codeinteltoprepositories.go | ||
| extensions.go | ||
| fetcher.go | ||
| notebooks.go | ||
| repos.go | ||
| search.go | ||
| users_test.go | ||
| users.go | ||
| utils_test.go | ||
| utils.go | ||