mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
prevent duplicate entries for push infos
This commit is contained in:
@@ -16,6 +16,7 @@ import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.commafeed.backend.model.FeedPushInfo;
|
||||
import com.commafeed.backend.services.ApplicationSettingsService;
|
||||
import com.commafeed.backend.services.FeedPushInfoService;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
|
||||
public class FeedRefreshWorker {
|
||||
@@ -35,6 +36,9 @@ public class FeedRefreshWorker {
|
||||
@Inject
|
||||
ApplicationSettingsService applicationSettingsService;
|
||||
|
||||
@Inject
|
||||
FeedPushInfoService feedPushInfoService;
|
||||
|
||||
public void start(MutableBoolean running, String threadName) {
|
||||
log.info("{} starting", threadName);
|
||||
|
||||
@@ -132,7 +136,7 @@ public class FeedRefreshWorker {
|
||||
log.debug("feed {} has pubsub info: {}", feed.getUrl(), topic);
|
||||
FeedPushInfo info = feed.getPushInfo();
|
||||
if (info == null) {
|
||||
info = new FeedPushInfo();
|
||||
info = feedPushInfoService.findOrCreate(feed, hub, topic);
|
||||
}
|
||||
if (!StringUtils.equals(hub, info.getHub())
|
||||
|| !StringUtils.equals(topic, info.getTopic())) {
|
||||
|
||||
Reference in New Issue
Block a user