Skip to content
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

Divide by zero issue with handle_usage_notifications #4411

Closed
zachaysan opened this issue Jul 29, 2024 · 0 comments · Fixed by #4428
Closed

Divide by zero issue with handle_usage_notifications #4411

zachaysan opened this issue Jul 29, 2024 · 0 comments · Fixed by #4428
Assignees
Labels
bug Something isn't working

Comments

@zachaysan
Copy link
Contributor

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/task_processor/processor.py", line 96, in _run_task
    task.run()
  File "/usr/local/lib/python3.11/site-packages/task_processor/models.py", line 66, in run
    return self.callable(*self.args, **self.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/organisations/tasks.py", line 125, in handle_api_usage_notifications
    handle_api_usage_notification_for_organisation(organisation)
  File "/app/organisations/task_helpers.py", line 117, in handle_api_usage_notification_for_organisation
    api_usage_percent = int(100 * api_usage / allowed_api_calls)
                            ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
ZeroDivisionError: division by zero
@zachaysan zachaysan self-assigned this Jul 29, 2024
@zachaysan zachaysan added the bug Something isn't working label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant