-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't re-enqueue a successful job if worker is in SHUTDOWN_IMMEDIATE …
…state
- Loading branch information
Florian Langenhahn
committed
Aug 13, 2018
1 parent
12884f9
commit 27519ee
Showing
4 changed files
with
63 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
28 changes: 28 additions & 0 deletions
28
src/test/java/net/greghaines/jesque/SleepWithExceptionAction.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.greghaines.jesque; | ||
|
||
import java.util.concurrent.Callable; | ||
|
||
/** | ||
* An action that sleeps for the given number of milliseconds and may throw an exception. | ||
* | ||
* @author Florian Langenhahn | ||
*/ | ||
public class SleepWithExceptionAction implements Callable<Void> { | ||
|
||
private final int millis; | ||
|
||
/** | ||
* Construct a sleep action. | ||
* | ||
* @param millis The number of milliseconds to sleep. | ||
*/ | ||
public SleepWithExceptionAction(int millis) { | ||
this.millis = millis; | ||
} | ||
|
||
@Override | ||
public Void call() throws Exception { | ||
Thread.sleep(millis); | ||
return null; | ||
} | ||
} |