diff --git a/.gitmodules b/.gitmodules index 28fd2369f7d..0501c3fb7f9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,9 +25,6 @@ [submodule "lib/ui-library"] path = lib/ui-library url = https://github.com/pkp/ui-library -[submodule "plugins/generic/acron"] - path = plugins/generic/acron - url = https://github.com/pkp/acron [submodule "plugins/generic/citationStyleLanguage"] path = plugins/generic/citationStyleLanguage url = https://github.com/pkp/citationStyleLanguage diff --git a/classes/scheduler/Scheduler.php b/classes/scheduler/Scheduler.php new file mode 100644 index 00000000000..070479608ac --- /dev/null +++ b/classes/scheduler/Scheduler.php @@ -0,0 +1,60 @@ +schedule + ->call(fn () => (new ReviewReminder())->execute()) + ->hourly() + ->name(ReviewReminder::class) + ->withoutOverlapping(); + + $this + ->schedule + ->call(fn () => (new EditorialReminders())->execute()) + ->daily() + ->name(EditorialReminders::class) + ->withoutOverlapping(); + + $this + ->schedule + ->call(fn () => (new PublishSubmissions())->execute()) + ->daily() + ->name(PublishSubmissions::class) + ->withoutOverlapping(); + + $this + ->schedule + ->call(fn () => (new UsageStatsLoader([]))->execute()) + ->daily() + ->name(UsageStatsLoader::class) + ->withoutOverlapping(); + } +} diff --git a/config.TEMPLATE.inc.php b/config.TEMPLATE.inc.php index 68cede26095..87b91c85c56 100644 --- a/config.TEMPLATE.inc.php +++ b/config.TEMPLATE.inc.php @@ -54,17 +54,6 @@ ; To set the "Secure" attribute for the cookie see the setting force_ssl at the [security] group session_samesite = Lax -; Enable support for running scheduled tasks -; Set this to On if you have set up the scheduled tasks script to -; execute periodically -scheduled_tasks = Off - -; Scheduled tasks will send email about processing -; only in case of errors. Set to off to receive -; all other kind of notification, including success, -; warnings and notices. -scheduled_tasks_report_error_only = On - ; Site time zone ; Please refer to https://www.php.net/timezones for a full list of supported ; time zones. @@ -583,6 +572,41 @@ ; Remove this setting to leave failed jobs in the database. delete_failed_jobs_after = 180 + +;;;;;;;;;;;;;;;;;;;;;;;;;; +; Schedule Task Settings ; +;;;;;;;;;;;;;;;;;;;;;;;;;; + +[schedule] + +; Whether or not to turn on the built-in schedule task runner +; +; When enabled, schedule tasks will be processed at the end of each web +; request to the application. +; +; Use of the built-in schedule task runner is highly discouraged for high-volume +; sites. Use your operational system's task scheduler instead, and configure +; it to run the task scheduler every minute. +; Sample for the *nix crontab +; * * * * * php lib/pkp/tools/scheduler.php run >> /dev/null 2>&1 +; +; See: +task_runner = On + +; How often should the built-in schedule task runner run scheduled tasks at the +; end of web request life cycle (value defined in seconds). +; +; This configuration will only have effect for the build-it task runner, it doesn't apply +; to the system crontab configuration. +; +; The default value is set to 60 seconds, a value smaller than that might affect the +; application performance negatively. +task_runner_interval = 60 + +; When enabled, an email with the scheduled task result will be sent only when an error +; has occurred. Otherwise, all tasks will generate a notification. +scheduled_tasks_report_error_only = On + [invitations] expiration_days = 3 diff --git a/dbscripts/xml/install.xml b/dbscripts/xml/install.xml index cd9e5da5180..3f2bcd8dd06 100644 --- a/dbscripts/xml/install.xml +++ b/dbscripts/xml/install.xml @@ -33,7 +33,6 @@ - diff --git a/dbscripts/xml/upgrade.xml b/dbscripts/xml/upgrade.xml index 7bad485c766..c91de13ed36 100644 --- a/dbscripts/xml/upgrade.xml +++ b/dbscripts/xml/upgrade.xml @@ -115,6 +115,7 @@ + diff --git a/docs/release-notes/README-3.5.0 b/docs/release-notes/README-3.5.0 index c853f3c8aeb..b5c2dab8f03 100644 --- a/docs/release-notes/README-3.5.0 +++ b/docs/release-notes/README-3.5.0 @@ -17,6 +17,13 @@ New config.inc.php parameters added for security: - cipher (default value: ''), cipher algorithm used to generate app key and encryption purpose - cookie_encryption (default value: ''), allow cookie encryption when set +New config.inc.php section for schedule task named schedule is added, with the following parameters: + - task_runner (default value: On), Whether or not to run the schedule tasks through web based task runner + - task_runner_interval (default value: 60), How often should the built-in web based task runner run scheduled tasks in seconds + - scheduled_tasks_report_error_only (default value: On), Whether or not schedule task execution failure details will be sent via mail + +- The setting general.scheduled_tasks has been removed. It was supposed to control the schedule tasks but had no impact. + New Features ------------ diff --git a/lib/pkp b/lib/pkp index 22af741d448..96faf2ed583 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit 22af741d448e394dcbaeb8cc652530f5705666e1 +Subproject commit 96faf2ed58329fad65baa62c2c088b5516fa9af5 diff --git a/locale/en/manager.po b/locale/en/manager.po index dd05d074431..10e240b97f5 100644 --- a/locale/en/manager.po +++ b/locale/en/manager.po @@ -741,9 +741,6 @@ msgstr "Review Options" msgid "manager.setup.reviewOptions.automatedReminders" msgstr "Automated Email Reminders" -msgid "manager.setup.reviewOptions.automatedRemindersDisabled" -msgstr "To activate these options, the site administrator must enable the scheduled_tasks option in the OMP configuration file. Additional server configuration may be required to support this functionality (which may not be possible on all servers), as indicated in the OMP documentation." - msgid "manager.setup.reviewOptions.onQuality" msgstr "Editors will rate reviewers on a five-point quality scale after each review." diff --git a/plugins/generic/acron b/plugins/generic/acron deleted file mode 160000 index cb707fdcb8d..00000000000 --- a/plugins/generic/acron +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cb707fdcb8ddb32fdbcfbc3cd4e74cd3e3b45431 diff --git a/registry/scheduledTasks.xml b/registry/scheduledTasks.xml deleted file mode 100644 index 0dddb55318d..00000000000 --- a/registry/scheduledTasks.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - Send automated reminders to reviewers to confirm or complete their assignments. - - - - Publish submissions that have been scheduled for publication. - - - - Send automated statistics reports to press managers and editors. - - - - Automatically remove unvalidated and expired users. - - - - Update the DB-IP city lite database periodically to ensure the geographical stats remain accurate. - - - - Process the usage stats logs and load the numbers into the DB tables. - - - - Send a monthly reminder email to editors about their outstanding tasks - - - - Process pending queue jobs in the default queue driver and queue - - - - Automatically remove jobs that failed more than X days ago. The time limit can be changed in the the delete_failed_jobs_after setting in the config file. - - - - Remove expired Invitations daily - - - diff --git a/tools/runScheduledTasks.php b/tools/runScheduledTasks.php deleted file mode 100644 index 9214085ebba..00000000000 --- a/tools/runScheduledTasks.php +++ /dev/null @@ -1,26 +0,0 @@ -execute();