Skip to content
Commit 50c5bdb8 authored by Markus Klein's avatar Markus Klein Committed by Benjamin Franzke
Browse files

[BUGFIX] Output errors to CLI in scheduler:run command

Whenever a scheduler task fails during execution
via CLI `scheduler:run`, the error message is
now always written to stderr.

This gives the task executor (e.g. cron) a chance
to identify any failures, if even stdout is
redirected to /dev/null.

The task-loop is adapted to avoid (ab)using
exceptions for control-flow (for loop-abortion).
It instead now uses nullables to signal that
not finding a next-task is expected behavior,
not an exception.

Also the exit code of the command is adapted
to switch to 1 in case at least one error
occured. (This is important in case the cronjob
is executed as systemd-timer)

Resolves: #87806
Releases: main, 11.5
Change-Id: I0b55bab7fcd916209114d9e3e07f54c7243ce9a5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78220


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenjamin Franzke <benjaminfranzke@gmail.com>
Reviewed-by: default avatarBenjamin Franzke <benjaminfranzke@gmail.com>
parent 2ccdcaa9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment