django-cron icon indicating copy to clipboard operation
django-cron copied to clipboard

get_time_until_run in core.py gives an error

Open GerardNL opened this issue 1 year ago • 0 comments

I've been using the django_cron for scheduled jobs and it's working pretty well. While looking at getting a status back from the jobs, I tried to use the function "get_time_until_run" in the CronJobBase class.

However, "cls.schedule.run_every_mins" (line 73) will give an error if the job is scheduled to run at fixed hours, instead of at certain intervals.

Not a big issue, but I think a simple if-statement could catch it at least?

something like (to be inserted before line 67:

if cls.schedule.run_every_mins == None:
      return timedelta()

that way it will at least not error.

GerardNL avatar Oct 06 '23 19:10 GerardNL