disable MastodonUserSync before more optimization

This commit is contained in:
Her Email 2023-12-10 13:51:33 -05:00 committed by Henri Dickson
parent 95f5e85883
commit bcdd65dd11
2 changed files with 5 additions and 2 deletions

View file

@ -7,7 +7,7 @@ from rq.registry import ScheduledJobRegistry
class BaseJob:
interval = timedelta(hours=1) # don't set it less than 1 minute
interval = timedelta(0) # 0 = disabled, don't set it less than 1 minute
@classmethod
def cancel(cls):
@ -25,6 +25,9 @@ class BaseJob:
@classmethod
def schedule(cls):
job_id = cls.__name__
if cls.interval <= timedelta(0):
logger.info(f"Skip scheduling job: {job_id}")
return
logger.info(f"Scheduling job: {job_id} in {cls.interval}")
django_rq.get_queue("cron").enqueue_in(
cls.interval,

View file

@ -11,7 +11,7 @@ from users.models import Preference, User
@JobManager.register
class MastodonUserSync(BaseJob):
interval = timedelta(hours=2)
interval = timedelta(hours=0)
def run(self):
logger.info("Mastodon User Sync start.")