Make RedisThread throw the error to an ExecutionResult in case RedisErrorQueueThread wants to do something with it

This commit is contained in:
moparisthebest 2013-08-21 14:46:00 -04:00
parent 87a4fd2154
commit ecf55b799c

View File

@ -113,9 +113,15 @@ public class RedisThread extends RedisScheduler implements Runnable {
}
timeoutCounter = 0;
if (debug) System.out.println("scheduledItemString: " + scheduledItemString);
final ExecutionResult executionResult = getExecutionResult(scheduledItemString);
try{
final ScheduledItem scheduledItem = om.readValue(scheduledItemString, ScheduledItem.class);
if (debug) System.out.println("scheduledItem object: " + scheduledItem);
executor.execute(scheduledItem, getExecutionResult(scheduledItemString));
executor.execute(scheduledItem, executionResult);
}catch(Throwable e){
if(executionResult != null)
executionResult.error(e);
}
}
} catch (Throwable e) {
e.printStackTrace();