From eaa42caeb03b5213754334a930b08407a0e74c53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 18 May 2022 14:38:32 +0200 Subject: [PATCH] Volltext-Suche: Hintergrund-Job nachts aktivieren --- SL/BackgroundJob/CreateOrUpdateFileFullTexts.pm | 2 +- sql/Pg-upgrade2/full_texts_background_job.sql | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 sql/Pg-upgrade2/full_texts_background_job.sql diff --git a/SL/BackgroundJob/CreateOrUpdateFileFullTexts.pm b/SL/BackgroundJob/CreateOrUpdateFileFullTexts.pm index e354aa17d..055accda3 100644 --- a/SL/BackgroundJob/CreateOrUpdateFileFullTexts.pm +++ b/SL/BackgroundJob/CreateOrUpdateFileFullTexts.pm @@ -22,7 +22,7 @@ my %extractor_by_mime_type = ( ); sub create_job { - $_[0]->create_standard_job('7 * * * *'); # seven minutes after every hour + $_[0]->create_standard_job('20 3 * * *'); # # every day at 3:20 am } # diff --git a/sql/Pg-upgrade2/full_texts_background_job.sql b/sql/Pg-upgrade2/full_texts_background_job.sql new file mode 100644 index 000000000..15a1ec9c6 --- /dev/null +++ b/sql/Pg-upgrade2/full_texts_background_job.sql @@ -0,0 +1,13 @@ +-- @tag: full_texts_background_job +-- @description: Hintergrundjob für tägliche Extraktion von Texten aus Dokumenten +-- @depends: release_3_6_0 + +INSERT INTO background_jobs (type, package_name, active, cron_spec, next_run_at) +VALUES ('interval', 'CreateOrUpdateFileFullTexts', true, '20 3 * * *', + CAST(current_date AS timestamp) + CAST( + (CASE + WHEN extract('hour' FROM current_timestamp) < 2 THEN '3 hours 20 minutes' + ELSE '1 day 3 hours 20 minutes' + END) AS interval + ) +); -- 2.20.1