mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
shutdown pool when application stops
This commit is contained in:
@@ -78,6 +78,17 @@ public class FeedRefreshUpdater {
|
||||
});
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
pool.shutdownNow();
|
||||
while (!pool.isTerminated()) {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
log.error("interrupted while waiting for threads to finish.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateFeed(Feed feed, Collection<FeedEntry> entries) {
|
||||
pool.execute(new Task(feed, entries));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user