force a feed refresh when someone subscribes

This commit is contained in:
Athou
2013-04-16 07:26:24 +02:00
parent 7034031417
commit b9fbf0fdf3
3 changed files with 23 additions and 8 deletions

View File

@@ -69,7 +69,16 @@ public class FeedRefreshWorker {
}
return new AsyncResult<Void>(null);
}
@Asynchronous
public void updateAsync(Feed feed){
try {
update(feed);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
private void update(Feed feed) throws NotSupportedException,
SystemException, SecurityException, IllegalStateException,
RollbackException, HeuristicMixedException,

View File

@@ -37,7 +37,7 @@ public class FeedSubscriptionService {
FeedSubscriptionDAO feedSubscriptionDAO;
@Lock(LockType.WRITE)
public void subscribe(User user, String url, String title,
public Feed subscribe(User user, String url, String title,
FeedCategory category) {
Feed feed = feedDAO.findByUrl(url);
@@ -72,5 +72,6 @@ public class FeedSubscriptionService {
}
feedEntryStatusDAO.save(statuses);
}
return feed;
}
}