forked from D-Net/dnet-hadoop
following the comment on the pull requests:
- Added #NUM_OF_THREADS complete job in the queue at the end of the main loop to avoid deadlock
This commit is contained in:
parent
a712df1e1d
commit
915a76a796
|
@ -135,7 +135,6 @@ public class ORCIDWorker extends Thread {
|
|||
orcidId = queue.take();
|
||||
|
||||
if (orcidId.equalsIgnoreCase(JOB_COMPLETE)) {
|
||||
queue.put(orcidId);
|
||||
hasComplete = true;
|
||||
} else {
|
||||
start = System.currentTimeMillis();
|
||||
|
|
|
@ -155,15 +155,17 @@ public class OrcidGetUpdatesFile {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 22; i++) {
|
||||
queue.put(ORCIDWorker.JOB_COMPLETE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (ORCIDWorker worker : workers) {
|
||||
worker.join();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue