Fixes #23611 - Provide helper method to run "service" active jobs
The root cause was we were triggering the active jobs too early, sometimes even before the db was migrated. This led to all sorts of errors. The provided helper method does not trigger the jobs when in any rake or in test environment. This helper should be reused in Katello as well.
Related issues
Bug #23611: ApplicationJob starts when foreman_tasks does not exist
The root cause was we were triggering the active jobs too early,
sometimes even before the db was migrated. This led to all sorts of
errors. The provided helper method does not trigger the jobs when in
any rake or in test environment. This helper should be reused in
Katello as well.