mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
smaller session boundary
This commit is contained in:
@@ -71,15 +71,13 @@ public class FeedRefreshTaskGiver implements Managed {
|
|||||||
FeedRefreshContext context = new UnitOfWork<FeedRefreshContext>(sessionFactory) {
|
FeedRefreshContext context = new UnitOfWork<FeedRefreshContext>(sessionFactory) {
|
||||||
@Override
|
@Override
|
||||||
protected FeedRefreshContext runInSession() throws Exception {
|
protected FeedRefreshContext runInSession() throws Exception {
|
||||||
FeedRefreshContext context = queues.take();
|
return queues.take();
|
||||||
if (context != null) {
|
|
||||||
feedRefreshed.mark();
|
|
||||||
worker.updateFeed(context);
|
|
||||||
}
|
|
||||||
return context;
|
|
||||||
}
|
}
|
||||||
}.run();
|
}.run();
|
||||||
if (context == null) {
|
if (context != null) {
|
||||||
|
feedRefreshed.mark();
|
||||||
|
worker.updateFeed(context);
|
||||||
|
} else {
|
||||||
log.debug("nothing to do, sleeping for 15s");
|
log.debug("nothing to do, sleeping for 15s");
|
||||||
threadWaited.mark();
|
threadWaited.mark();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user