-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Set organisation api usage to zero #4611
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Docker builds report
|
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4611 +/- ##
=======================================
Coverage 97.16% 97.17%
=======================================
Files 1160 1160
Lines 40137 40181 +44
=======================================
+ Hits 39000 39045 +45
+ Misses 1137 1136 -1 ☔ View full report in Codecov by Sentry. |
What if Postgres is being used to store usage data instead of influx? |
Presently the That said, if we want to support the Postgres way of going about things then I'd argue we should create a new GitHub issue instead of lumping it in with this PR. |
Changes
The original code involved in setting
api_calls_24h
,api_calls_7d
, andapi_calls_30d
for theOrganisationSubscriptionInformationCache
only updated values that were known to InfluxDB, this led to an issue where once an organisation left Flagsmith the code updating the values for0
level API responses were instead left their previous value. This PR fixes that by checking for organisations that have no values and sets them to0
.How did you test this code?
Partially manually against production InfluxDB and then added a test for the empty caches case.