avc
August 26, 2024, 4:19pm
10
Hi again @gtapias :
I think I found the reason for that …
If the system detects no interactive activity (mean manual login) in the site for the last x days (defined on system settings) and you are not in developer_mode (since v15.38.0) … jobs will get “dormant” status … and, theorically, it will run just daily. I think something like this is happening. This is the reason why it restarts after logout/login
def enable_scheduler():
toggle_scheduler(True)
def disable_scheduler():
toggle_scheduler(False)
@redis_cache(ttl=60 * 60)
def schedule_jobs_based_on_activity(check_time=None):
"""Return True for active sites as defined by `Activity Log`.
Also return True for inactive sites once every 24 hours based on `Scheduled Job Log`."""
if is_dormant(check_time=check_time):
# ensure last job is one day old
last_job_timestamp = _get_last_creation_timestamp("Scheduled Job Log")
if not last_job_timestamp:
return True
else:
if ((check_time or now_datetime()) - last_job_timestamp).total_seconds() >= 86400:
# one day is passed since jobs are run, so lets do this
And finally … check this:
opened 06:13AM - 31 Jul 24 UTC
closed 10:52AM - 12 Aug 24 UTC
bug
released
**Story**:
My site was working just fine until one day it did not.
All the s… cheduled jobs were not being processed.
After much debugging with @adityahase, the issue was figured out.
**Premise:**
I had not logged out from the site in a while and somehow the site went into dormant mode. (Activity Log).
And even after the logout and login, nothing changed cause "cache" :)
Clearing the cache solved the issue.
**Solution**
Give no regard to the dormant mode when a site is in developer mode.
Maybe bench clear-cache could help too in some cases.