Search in sources :

Example 1 with DataFeed

use of org.structr.feed.entity.DataFeed in project structr by structr.

the class UpdateFeedAgent method processTask.

@Override
public ReturnValue processTask(final Task<T> task) throws Throwable {
    logger.debug("Processing task {}", task.getClass().getName());
    final App app = StructrApp.getInstance();
    try (final Tx tx = app.tx(true, true, false)) {
        for (DataFeed feed : task.getWorkObjects()) {
            logger.debug("Updating data feed {} if due", feed.getProperty(DataFeed.name));
            feed.updateIfDue();
        }
        tx.success();
    }
    return ReturnValue.Success;
}
Also used : StructrApp(org.structr.core.app.StructrApp) App(org.structr.core.app.App) Tx(org.structr.core.graph.Tx) DataFeed(org.structr.feed.entity.DataFeed)

Aggregations

App (org.structr.core.app.App)1 StructrApp (org.structr.core.app.StructrApp)1 Tx (org.structr.core.graph.Tx)1 DataFeed (org.structr.feed.entity.DataFeed)1