Skip to content

Commit

Permalink
Update calling code for influxdb wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
zachaysan committed Aug 2, 2024
1 parent 09866e3 commit fddaf8d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/organisations/task_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ def handle_api_usage_notification_for_organisation(organisation: Organisation) -
month_delta = relativedelta(now, billing_starts_at).months
period_starts_at = relativedelta(months=month_delta) + billing_starts_at

days = relativedelta(now, period_starts_at).days
allowed_api_calls = subscription_cache.allowed_30d_api_calls

api_usage = get_current_api_usage(organisation.id, f"-{days}d")
api_usage = get_current_api_usage(organisation.id, period_starts_at)

# For some reason the allowed API calls is set to 0 so default to the max free plan.
allowed_api_calls = allowed_api_calls or MAX_API_CALLS_IN_FREE_PLAN
Expand Down

0 comments on commit fddaf8d

Please sign in to comment.