Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Scheduler] Add FailureEvent #52087

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

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Conversation

alli83
Copy link
Contributor

@alli83 alli83 commented Oct 16, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT

Following PR #51805, It would be interesting to add a failureEvent allowing you, for instance, to remove the recurring message, depending on the error caught.

$this->dispatcher->dispatch(new PostRunEvent($generator->getSchedule(), $context, $message));
$this->dispatcher->dispatch(new PostRunEvent($generator->getSchedule(), $context, $message));
} catch (\Throwable $error) {
$this->dispatcher->dispatch(new FailureEvent($generator->getSchedule(), $context, $message, $error));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to rethrow the exception, right?
And maybe the FailureEvent can have a way to ignore the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes indeed. Maybe I could add a shouldIgnore like the one we already have for the WorkerMessageReceivedEvent

@OskarStark OskarStark changed the title [Scheduler] add failure event [Scheduler] Add FailureEvent Oct 17, 2023
@alli83 alli83 force-pushed the scheduler-add-failure-event branch 2 times, most recently from 329592e to e39d744 Compare October 17, 2023 08:43
@alli83 alli83 force-pushed the scheduler-add-failure-event branch from e39d744 to 891a404 Compare October 17, 2023 08:43
@fabpot
Copy link
Member

fabpot commented Oct 17, 2023

Thank you @alli83.

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

Successfully merging this pull request may close these issues.

3 participants