Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions schedule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,13 @@ def do(self, job_func: Callable, *args, **kwargs):
self.scheduler.jobs.append(self)
return self

def add_time_to_next_run(self, seconds=0, minutes=0, hours=0, days=0, weeks=0, months=0, years=0):
"""
function to add time to the next_run of a job and ONLY the next run
"""
time_in_seconds = seconds + (minutes * 60) + (hours * 3600) + (days * 86400) + (weeks * 604800) + (months * 259200) + (years * 31536000)
self.next_run = self.next_run + datetime.timedelta(seconds=time_in_seconds)

@property
def should_run(self) -> bool:
"""
Expand Down