Skip to content

Commit

Permalink
Merge pull request #35034 from dimagi/nh/drop_is_ready
Browse files Browse the repository at this point in the history
Drop unused `Repeater.is_ready()`
  • Loading branch information
kaapstorm authored Aug 26, 2024
2 parents e7ee562 + 071c190 commit 83b9580
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions corehq/motech/repeaters/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,6 @@ def _repeater_type(cls):
def repeat_records_ready(self):
return self.repeat_records.filter(state__in=(State.Pending, State.Fail))

@property
def is_ready(self):
"""
Returns True if there are repeat records to be sent.
"""
if self.is_paused or toggles.PAUSE_DATA_FORWARDING.enabled(self.domain):
return False
if not (self.next_attempt_at is None
or self.next_attempt_at < timezone.now()):
return False
return self.repeat_records_ready.exists()

def set_next_attempt(self):
now = datetime.utcnow()
interval = _get_retry_interval(self.last_attempt_at, now)
Expand Down

0 comments on commit 83b9580

Please sign in to comment.