Skip to content

Commit

Permalink
Handle tasks dangling in STARTED state (mark them as failed after 30 …
Browse files Browse the repository at this point in the history
…seconds)

git-svn-id: https://sagetv-addons.googlecode.com/svn/trunk/sjq4@1341 4d529e3f-d655-0410-97be-dbb2a4780eb3
  • Loading branch information
[email protected] committed Jan 19, 2011
1 parent 44090c4 commit c5b9f0f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public void run() {
synchronized(TaskQueue.get()) {
DataStore ds = DataStore.get();
for(QueuedTask qt : ds.getActiveQueue()) {
if(qt.getState() == QueuedTask.State.RUNNING) {
if(qt.getState() == QueuedTask.State.RUNNING || qt.getState() == QueuedTask.State.STARTED) {
if(qt.getState() == QueuedTask.State.STARTED && System.currentTimeMillis() - qt.getStarted().getTime() < 30000) // Skip tasks that were just assigned; give the client 30 seconds to update the state
continue;
++i;
AgentClient agent = null;
try {
Expand Down

0 comments on commit c5b9f0f

Please sign in to comment.