Skip to content

Commit

Permalink
clarify comparison units
Browse files Browse the repository at this point in the history
  • Loading branch information
claire-peters committed Aug 13, 2024
1 parent 146f209 commit da34d15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coldfront/core/utils/fasrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ def get_resource_rate(resource):
return round(price/100, 2)


def allocation_reaching_capacity_operations(allocation_obj, new_usage):
"""if allocation_obj.usage is <80/90% of allocation_obj.limit and new_usage
def allocation_reaching_capacity_operations(allocation_obj, new_byte_usage):
"""if allocation_obj.usage is <80/90% of allocation_obj.limit and new_byte_usage
>80/90% of allocation_obj.limit, send email to pi and data manager.
"""
threshold = None
for limit in [90, 80]:
if (
allocation_obj.usage_exact/allocation_obj.size_exact < limit/100
and new_usage/allocation_obj.size > limit/100
and new_byte_usage/allocation_obj.size_exact > limit/100
):
threshold = limit
if threshold:
Expand Down

0 comments on commit da34d15

Please sign in to comment.