Skip to content

Commit

Permalink
Updated the docstrings to comply with the other ones
Browse files Browse the repository at this point in the history
  • Loading branch information
HomerusJa committed Dec 21, 2024
1 parent 9b423b3 commit 5f504e4
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/apscheduler/triggers/combining.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ class OrTrigger(BaseCombiningTrigger):
fire times.
:param triggers: triggers to combine
:param cooldown_period: minimum time between two consecutive fires (in seconds, or as
timedelta)
"""

cooldown_period: timedelta = attrs.field(converter=as_timedelta, default=0)
Expand All @@ -131,13 +133,10 @@ def _get_next_valid_fire_time(self) -> tuple[datetime | None, list[int]]:
"""
Find the next valid fire time that respects the cooldown period.
Raises:
MaxIterationsReached: If the maximum number of iterations is reached
Returns:
A tuple of (fire_time, trigger_indices) where fire_time is the next valid
fire time (or None if no valid time exists) and trigger_indices is a list
of indices of triggers that produced this fire time.
:raises MaxIterationsReached: If the maximum number of iterations is reached
:returns: A tuple of (fire_time, trigger_indices) where fire_time is the next valid
fire time (or None if no valid time exists) and trigger_indices is a list
of indices of triggers that produced this fire time.
"""
for _ in range(self.max_iterations):
earliest_time = min(
Expand Down Expand Up @@ -174,12 +173,6 @@ def _get_next_valid_fire_time(self) -> tuple[datetime | None, list[int]]:
raise MaxIterationsReached

def next(self) -> datetime | None:
"""
Get the next fire time that respects the cooldown period.
Returns:
The next valid fire time, or None if no more fire times exist.
"""
# Initialize fire times if needed
if not self._next_fire_times:
self._next_fire_times = [t.next() for t in self.triggers]
Expand Down

0 comments on commit 5f504e4

Please sign in to comment.