forked from resque/resque
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Set blacklisted exceptions #12
Open
konstantinoskostis
wants to merge
7
commits into
skroutz
Choose a base branch
from
set_blacklisted_exceptions_improved
base: skroutz
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
konstantinoskostis
force-pushed
the
set_blacklisted_exceptions_improved
branch
from
August 2, 2019 08:03
cf5ae54
to
1389fb1
Compare
konstantinoskostis
force-pushed
the
set_blacklisted_exceptions_improved
branch
from
August 2, 2019 10:07
1389fb1
to
97469bf
Compare
dblia
reviewed
Aug 5, 2019
This commit introduces a new module for accessing a class variable named `blacklist`. This class variable represents exceptions that will not be pushed to the failed queue when a job fails with an exception that is included in the blacklist. Every class that includes this module can access/manipulate its `blacklist` class variable. Also it adds a method called `blacklisted_exception_raised?` which checks if the raised exception belongs to the backend's blacklisted exceptions.
This commit allows Resque::Failure::Base to include the module BlacklistExceptionsRegistrar and by extension allowing every descendant of base class to manipulate its `blacklist` class variable.
konstantinoskostis
force-pushed
the
set_blacklisted_exceptions_improved
branch
from
August 5, 2019 09:28
97469bf
to
bae2706
Compare
@dblia @eavgerinos changes have been made, re-review at your earliest convenience |
dblia
approved these changes
Aug 5, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This commit uses the `blacklisted_exception_raised?`, provided by the BlacklistExceptionsRegistrar module, to determine if the raised exception of the failed job is a blacklisted exception and by extension if the job should be pushed to the failed queue or not.
This commit uses the `blacklisted_exception_raised?`, provided by the BlacklistExceptionsRegistrar module, to determine if the raised exception of the failed job is a blacklisted exception and by extension if the job should be pushed to the failed queue or not.
This commit uses the `blacklisted_exception_raised?`, provided by the BlacklistExceptionsRegistrar module, to determine if the save method of a respective backend should be called or not if a failed job with a given exception occurs.
konstantinoskostis
force-pushed
the
set_blacklisted_exceptions_improved
branch
from
August 5, 2019 10:31
bae2706
to
d1e090d
Compare
@dblia @eavgerinos a few more tests are added for redis test file, so now all methods in the registrar module are tested! |
konstantinoskostis
force-pushed
the
set_blacklisted_exceptions_improved
branch
from
August 5, 2019 12:17
d1e090d
to
c5e6fed
Compare
konstantinoskostis
force-pushed
the
set_blacklisted_exceptions_improved
branch
from
August 5, 2019 14:30
c5e6fed
to
4ff4dad
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request allows accessing/modifying of a blacklist of exceptions of a Resque Failure backend
which is a class variable of a Resque::Failure::Base class. So, each backend by calling
set_blacklisted_exceptions
on the class, can set itsmonitored
blacklisted exceptions and this is independent of the backend class (e.g Redis might have its own exceptions and a RedisMultiQueue might have its own and they can also later be added to a Multiple backend if a user needs many failure backends)