mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
lock on entry url
This commit is contained in:
@@ -134,15 +134,15 @@ public class FeedRefreshUpdater {
|
|||||||
|
|
||||||
private boolean updateEntry(final Feed feed, final FeedEntry entry,
|
private boolean updateEntry(final Feed feed, final FeedEntry entry,
|
||||||
final List<FeedSubscription> subscriptions) {
|
final List<FeedSubscription> subscriptions) {
|
||||||
Lock lock = locks.get(entry.getGuid());
|
String key = entry.getUrl();
|
||||||
|
Lock lock = locks.get(key);
|
||||||
boolean locked = false;
|
boolean locked = false;
|
||||||
try {
|
try {
|
||||||
locked = lock.tryLock(1, TimeUnit.MINUTES);
|
locked = lock.tryLock(1, TimeUnit.MINUTES);
|
||||||
if (locked) {
|
if (locked) {
|
||||||
feedUpdateService.updateEntry(feed, entry, subscriptions);
|
feedUpdateService.updateEntry(feed, entry, subscriptions);
|
||||||
} else {
|
} else {
|
||||||
log.error("lock timeout for " + feed.getUrl() + " - "
|
log.error("lock timeout for " + feed.getUrl() + " - " + key);
|
||||||
+ entry.getGuid());
|
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
log.error("interrupted while waiting for lock for " + feed.getUrl()
|
log.error("interrupted while waiting for lock for " + feed.getUrl()
|
||||||
|
|||||||
Reference in New Issue
Block a user