|
|
|
@ -36,8 +36,18 @@ public enum ForgeManager implements Runnable {
@@ -36,8 +36,18 @@ public enum ForgeManager implements Runnable {
|
|
|
|
|
|
|
|
|
|
while (true) { |
|
|
|
|
|
|
|
|
|
WorkOrder workOrder = null; |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
WorkOrder workOrder = forge.take(); |
|
|
|
|
workOrder = forge.take(); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
Logger.error(e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (workOrder == null) { |
|
|
|
|
Logger.error("NULL workOrder in queue"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Completed or canceled work orders are not re-enqueued
|
|
|
|
|
|
|
|
|
@ -72,10 +82,6 @@ public enum ForgeManager implements Runnable {
@@ -72,10 +82,6 @@ public enum ForgeManager implements Runnable {
|
|
|
|
|
workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration; |
|
|
|
|
forge.add(workOrder); |
|
|
|
|
Logger.info(workOrder.toString()); |
|
|
|
|
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|