Skip to content

Commit

Permalink
Formatting file
Browse files Browse the repository at this point in the history
  • Loading branch information
gherceg committed Jan 23, 2025
1 parent b852123 commit 0e9386f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions corehq/project_limits/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.db import models

import architect
from django.db import models

AVG = 'AVG'
MAX = 'MAX'
Expand Down Expand Up @@ -29,6 +28,7 @@ def delete(self, *args, **kwargs):

def _clear_caches(self):
from corehq.project_limits.rate_limiter import get_dynamic_rate_definition

get_dynamic_rate_definition.clear(self.key, {})


Expand All @@ -37,6 +37,7 @@ class GaugeDefinition(models.Model):
An abstract model to be used to define configuration to limit gauge values.
The model is used by GaugeLimiter class to decide weather to limit or not.
"""

key = models.CharField(max_length=512, blank=False, null=False, unique=True, db_index=True)
wait_for_seconds = models.IntegerField(null=False)
acceptable_value = models.FloatField(default=None, blank=True, null=True)
Expand All @@ -59,12 +60,12 @@ def _clear_caches(self):


class PillowLagGaugeDefinition(GaugeDefinition):

max_value = models.FloatField(default=None, blank=True, null=True)
average_value = models.FloatField(default=None, blank=True, null=True)

def _clear_caches(self):
from corehq.project_limits.gauge import get_pillow_throttle_definition

get_pillow_throttle_definition.clear(self.key)


Expand Down

0 comments on commit 0e9386f

Please sign in to comment.