Tivix / django-cron

Write cron business logic as a Python class and let this app do the rest! It enables Django projects to schedule cron tasks, tracks their success / failures, manages contention (via a cache) etc. Basically takes care of all the boring work for you :-)
www.tivix.com
MIT License
900 stars 193 forks source link

Set user_time for RUN_AT_TIMES #134

Closed tatulea closed 2 years ago

tatulea commented 6 years ago

Hi,

I think it would be nice to set user_time to cron_job_class be allow user to check the time for which the cron will run.

I did it just adding:

setattr(self.cron_job_class, 'user_time', time_data)

on 147 line from init.py.

Could you put it in thr project also, please?

Thank you!

glotchimo commented 6 years ago

Do you mean to limit the amount of time the cron is allowed to run?

tatulea commented 6 years ago

No, to be able to access in self the time that the cron was set to run. I had a cron and I needed to know the time that it was intended to run at