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
1 changed files with 9 additions and 3 deletions

View File

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