wait for lock for one minute, then timeout

This commit is contained in:
Athou
2013-05-27 11:42:01 +02:00
parent 475391c6a7
commit c0df050184

View File

@@ -131,9 +131,12 @@ public class FeedRefreshUpdater {
private void updateEntry(final Feed feed, final FeedEntry entry,
final List<FeedSubscription> subscriptions) {
Lock lock = locks.get(entry.getGuid());
lock.lock();
try {
lock.tryLock(1, TimeUnit.MINUTES);
feedUpdateService.updateEntry(feed, entry, subscriptions);
} catch (InterruptedException e) {
log.error("interrupted while waiting for lock: " + e.getMessage(),
e);
} finally {
lock.unlock();
}