Reset the failure flag in workers on successful runs. #76
@ -58,6 +58,16 @@ public abstract class AbstractWorker implements Worker {
|
||||
* Do manually transaction-handled work
|
||||
*/
|
||||
try {
|
||||
// When the switch from Guice to Spring happened all workers became singletons
|
||||
// because that's the default in Spring. In Guice they were "prototype" scoped
|
||||
// and therefore the worker object was re-created before each execution which
|
||||
// reset the successfulWorker field to true.
|
||||
//
|
||||
// Now that they're singletons the field is never reset to true after a
|
||||
// failure and the worker will be stuck in a failed state even after a
|
||||
// subsequent successful run.
|
||||
setSuccessfulWorker(true);
|
||||
|
||||
doWork();
|
||||
} catch (RuntimeException ex) {
|
||||
LOGGER.info("Worker {} threw an exception", getClass().getSimpleName());
|
||||
|
Loading…
x
Reference in New Issue
Block a user