Version 1
[yaffs-website] / web / core / modules / aggregator / src / Plugin / QueueWorker / AggregatorRefresh.php
diff --git a/web/core/modules/aggregator/src/Plugin/QueueWorker/AggregatorRefresh.php b/web/core/modules/aggregator/src/Plugin/QueueWorker/AggregatorRefresh.php
new file mode 100644 (file)
index 0000000..d3ffd00
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+
+namespace Drupal\aggregator\Plugin\QueueWorker;
+
+use Drupal\aggregator\FeedInterface;
+use Drupal\Core\Queue\QueueWorkerBase;
+
+/**
+ * Updates a feed's items.
+ *
+ * @QueueWorker(
+ *   id = "aggregator_feeds",
+ *   title = @Translation("Aggregator refresh"),
+ *   cron = {"time" = 60}
+ * )
+ */
+class AggregatorRefresh extends QueueWorkerBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function processItem($data) {
+    if ($data instanceof FeedInterface) {
+      $data->refreshItems();
+    }
+  }
+
+}