fix for solr shutdown

pull/1/head
Michael Peter Christen 13 years ago
parent b8bcc06283
commit 8a6edc0031

@ -72,6 +72,7 @@ public class MultipleSolrConnector implements SolrConnector {
@Override @Override
public void close() { public void close() {
// send termination signal to worker
for (@SuppressWarnings("unused") AddWorker element : this.worker) { for (@SuppressWarnings("unused") AddWorker element : this.worker) {
try { try {
this.queue.put(POISON_DOC); this.queue.put(POISON_DOC);
@ -79,6 +80,14 @@ public class MultipleSolrConnector implements SolrConnector {
e.printStackTrace(); e.printStackTrace();
} }
} }
// wait for termination
for (AddWorker element : this.worker) {
try {
element.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
this.solr.close(); this.solr.close();
} }

Loading…
Cancel
Save