Return early if the post shouldn't be pushed

References #328
This commit is contained in:
Oliver Davies 2021-01-10 16:18:24 +00:00
parent 73271de39a
commit e617e9984d

View file

@ -17,6 +17,11 @@ use Drupal\opdavies_blog\Entity\Node\Post;
final class PostPusherQueueWorker extends QueueWorkerBase {
public function processItem($data): void {
['post' => $post] = $data;
if (!$this->shouldBePushed($post)) {
return;
}
}
private function shouldBePushed(Post $post): bool {