Follow-up from "Bypass min/max queries in usage data queries"
The following discussion from !58006 (merged) should be addressed:
🤔I have one remaining concern here, how to ensure that the clear memoized values? ♻
With this methods becoming more abstract, we could easy forget to add new keys in the list of keys:
There is a test that checks this for defined keys only. https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/lib/gitlab/usage_data_spec.rb#L39
I think if we take care of the memoized values behind the scene we should do the same with the cleaning.
One idea could be to store the keys in an array as we memoize the values and use this array. And use that array of keys to clear memoization in
This can be addressed as a follow-up issue.