Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizon: Exclude certain jobs from Completed Jobs list #1153

Closed
hailwood opened this issue May 25, 2022 · 4 comments · Fixed by #1232
Closed

Horizon: Exclude certain jobs from Completed Jobs list #1153

hailwood opened this issue May 25, 2022 · 4 comments · Fixed by #1232

Comments

@hailwood
Copy link

hailwood commented May 25, 2022

Right now Horizon displays all jobs that have completed in the Completed Jobs list.
This is great, unless you've got jobs running that you don't really care about -

For example we use OhDearApp so if the job fails we'll know about it from OhDearApp notifying us.
The issue we run into is that it fires one job per scheduled task per execution - and this is drowning out the less often jobs we do care about.

It would be great if either in the horizon config we could have a way to say 'hide these jobs'

'hide_completed_jobs' => [
    PingOhDearJob::class,
],

Or a closure based approach like (complete pseudocode)

Horizon::filterJob(function(Job $job) {
   return $job->className !== PingOhDearJob::class || !$job->isComplete;
});

horizon_jobs_completed

@driesvints
Copy link
Member

I like the idea here. Maybe the following config?

'jobs' => [
    'exclude' => [
        PingOhDearJob::class,
    ],
],

I'll ping @taylorotwell to see if we can accept a PR for this.

@taylorotwell
Copy link
Member

I'm fine with this if someone wants to make a PR. 👍

@driesvints
Copy link
Member

Feel free to PR something 👍

@driesvints driesvints changed the title Exclude certain jobs from Completed Jobs list Horizon: Exclude certain jobs from Completed Jobs list Jun 25, 2022
@driesvints
Copy link
Member

@hailwood I've started working on something here: #1230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants