dbader / dbader/schedule

Cant seem to run or even schedule a task at all, checked multiple sources all of them have different variations of the same solutions none work

Open
#527 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12.3k
Forks
999
PR merge metrics
No merged PRs in 30d

Description

This is the code nothing seems to work

@client.event
async def on_ready(self):
schedule.every(1).seconds.do(self.local, script_path, update())
self.job_func = functools.partial(job_func, *args, **kwargs)
schedule.run_pending()

#-----------------------------------------------------------------------------------------------------------------------
def do(self, job_func, *args, **kwargs):
"""
Specifies the job_func that should be called every time the
job runs.
Any additional arguments are passed on to job_func when
the job runs.
:param job_func: The function to be scheduled
:return: The invoked job instance
"""
self.job_func = functools.partial(job_func, *args, **kwargs)
functools.update_wrapper(self.job_func, job_func)
self._schedule_next_run()
if self.scheduler is None:
raise ScheduleError("Unable to a add job to schedule.\n Job is not associated with an scheduler.")
self.scheduler.jobs.append(self)
return

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.