From aea537dc6442ef10cbdaef400478dd32ac9d0747 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:25:32 -0800 Subject: [PATCH] Once per hour --- src/paperless/settings.py | 6 +++--- src/paperless/tests/test_settings.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/paperless/settings.py b/src/paperless/settings.py index e8fd455a8..44a862120 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -219,12 +219,12 @@ def _parse_beat_schedule() -> dict: { "name": "Check and run scheduled workflows", "env_key": "PAPERLESS_WORKFLOW_SCHEDULED_TASK_CRON", - # Default every 5 minutes - "env_default": "*/5 * * * *", + # Default hourly at 5 minutes past the hour + "env_default": "5 */1 * * *", "task": "documents.tasks.check_scheduled_workflows", "options": { # 1 minute before default schedule sends again - "expires": 4.0 * 60.0, + "expires": 59.0 * 60.0, }, }, ] diff --git a/src/paperless/tests/test_settings.py b/src/paperless/tests/test_settings.py index 77423b9f6..fe7356947 100644 --- a/src/paperless/tests/test_settings.py +++ b/src/paperless/tests/test_settings.py @@ -157,7 +157,7 @@ class TestCeleryScheduleParsing(TestCase): INDEX_EXPIRE_TIME = 23.0 * 60.0 * 60.0 SANITY_EXPIRE_TIME = ((7.0 * 24.0) - 1.0) * 60.0 * 60.0 EMPTY_TRASH_EXPIRE_TIME = 23.0 * 60.0 * 60.0 - RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME = 4.0 * 60.0 + RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME = 59.0 * 60.0 def test_schedule_configuration_default(self): """ @@ -199,7 +199,7 @@ class TestCeleryScheduleParsing(TestCase): }, "Check and run scheduled workflows": { "task": "documents.tasks.check_scheduled_workflows", - "schedule": crontab(minute="*/5"), + "schedule": crontab(minute="5", hour="*/1"), "options": {"expires": self.RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME}, }, }, @@ -251,7 +251,7 @@ class TestCeleryScheduleParsing(TestCase): }, "Check and run scheduled workflows": { "task": "documents.tasks.check_scheduled_workflows", - "schedule": crontab(minute="*/5"), + "schedule": crontab(minute="5", hour="*/1"), "options": {"expires": self.RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME}, }, }, @@ -295,7 +295,7 @@ class TestCeleryScheduleParsing(TestCase): }, "Check and run scheduled workflows": { "task": "documents.tasks.check_scheduled_workflows", - "schedule": crontab(minute="*/5"), + "schedule": crontab(minute="5", hour="*/1"), "options": {"expires": self.RUN_SCHEDULED_WORKFLOWS_EXPIRE_TIME}, }, },