2020-05-24 15:44:27 +00:00
|
|
|
from core.classes.cron import Cronjob
|
2020-05-24 17:22:17 +00:00
|
|
|
from core.helpers.auth import clear_login_log, clear_ratelimits
|
2020-06-02 15:58:20 +00:00
|
|
|
from core.helpers.cron import clear_cron_log
|
2020-05-24 15:44:27 +00:00
|
|
|
|
|
|
|
CRONDEFINITIONS = []
|
|
|
|
CRONFUNCTIONS = {}
|
|
|
|
|
|
|
|
### Demonstration Cronjob
|
|
|
|
|
|
|
|
def debug_job():
|
|
|
|
return "Test"
|
|
|
|
|
|
|
|
debug_cron = Cronjob("core.debug_job", "* * * * *")
|
|
|
|
|
|
|
|
# CRONFUNCTIONS["core.debug_job"] = debug_job
|
|
|
|
# CRONDEFINITIONS.append(debug_cron)
|
|
|
|
|
|
|
|
### Remove old entries from the login log
|
|
|
|
|
|
|
|
loginlog_cron = Cronjob("core.clear_login_log", "* * * * *")
|
|
|
|
|
|
|
|
CRONFUNCTIONS["core.clear_login_log"] = clear_login_log
|
2020-05-24 17:22:17 +00:00
|
|
|
CRONDEFINITIONS.append(loginlog_cron)
|
|
|
|
|
|
|
|
### Remove old entries from the rate limit table
|
|
|
|
|
|
|
|
ratelimit_cron = Cronjob("core.clear_ratelimits", "* * * * *")
|
|
|
|
|
|
|
|
CRONFUNCTIONS["core.clear_ratelimits"] = clear_ratelimits
|
2020-06-02 15:58:20 +00:00
|
|
|
CRONDEFINITIONS.append(ratelimit_cron)
|
|
|
|
|
|
|
|
### Remove old entries from the cron execution log
|
|
|
|
|
|
|
|
cronlog_cron = Cronjob("core.clear_cron_log", "* * * * *")
|
|
|
|
|
|
|
|
CRONFUNCTIONS["core.clear_cron_log"] = clear_cron_log
|
|
|
|
CRONDEFINITIONS.append(cronlog_cron)
|