-
Sub-task
-
Resolution: Obsolete
-
Undefined
-
None
-
None
-
None
-
None
As discovered during PR review (https://github.com/theforeman/foreman/pull/10784/changes/BASE..5ca5a66b3557d8efe27129c5aa8b2dacf3cdc4b2#r2667468333), some recurring rake tasks(e.g. audits:expire) that call exit will abort the entire process and skip subsequent tasks when run via systemd timers framework.
This causes the entire cron:* rake invocation to abort early, silently skipping any subsequent tasks, while still exiting with success.
This behavior was acceptable when tasks were executed individually via cron, but is incompatible with the new framework where multiple tasks are executed sequentially via cron:daily, cron:weekly, etc.
Scope:
- Refactor `audits:expire` to return gracefully instead of calling exit - https://github.com/theforeman/foreman/blob/d64ee4e6bf459746cab89e08a858374445adbe53/lib/tasks/audits.rake#L69-L70
- Review and fix similar patterns in `reports:* tasks`
- Ensure tasks do not abort the entire cron run