mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
ability to queue a feed for refresh
This commit is contained in:
@@ -14,7 +14,7 @@ import com.commafeed.backend.StartupBean;
|
||||
import com.commafeed.backend.dao.FeedDAO;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.services.ApplicationSettingsService;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Queues;
|
||||
|
||||
@Singleton
|
||||
public class FeedRefreshTaskGiver {
|
||||
@@ -28,7 +28,14 @@ public class FeedRefreshTaskGiver {
|
||||
@Inject
|
||||
StartupBean startupBean;
|
||||
|
||||
private Queue<Feed> queue = Lists.newLinkedList();
|
||||
private Queue<Feed> queue = Queues.newConcurrentLinkedQueue();
|
||||
|
||||
@Lock(LockType.WRITE)
|
||||
public void add(Feed feed) {
|
||||
queue.add(feed);
|
||||
feed.setLastUpdated(Calendar.getInstance().getTime());
|
||||
feedDAO.update(feed);
|
||||
}
|
||||
|
||||
@Lock(LockType.WRITE)
|
||||
public Feed take() {
|
||||
|
||||
Reference in New Issue
Block a user