smaller session boundary

This commit is contained in:
Athou
2014-08-18 15:30:25 +02:00
parent ea68dbc56f
commit 17a5ef882f

View File

@@ -71,15 +71,13 @@ public class FeedRefreshTaskGiver implements Managed {
FeedRefreshContext context = new UnitOfWork<FeedRefreshContext>(sessionFactory) {
@Override
protected FeedRefreshContext runInSession() throws Exception {
FeedRefreshContext context = queues.take();
if (context != null) {
feedRefreshed.mark();
worker.updateFeed(context);
}
return context;
return queues.take();
}
}.run();
if (context == null) {
if (context != null) {
feedRefreshed.mark();
worker.updateFeed(context);
} else {
log.debug("nothing to do, sleeping for 15s");
threadWaited.mark();
try {