Skip to content

Commit

Permalink
UHF-10581: add reindex exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rpnykanen committed Oct 7, 2024
1 parent e7fd339 commit e6fe136
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\Core\Queue\RequeueException;
use Drupal\helfi_google_api\JobIndexingService;
use Drupal\helfi_rekry_content\Entity\JobListing;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down Expand Up @@ -63,7 +64,7 @@ public static function create(ContainerInterface $container, array $configuratio
* {@inheritdoc}
*/
public function processItem($data): void {
if (!$data['nid']) {
if (!isset($data['nid'])) {
return;
}

Expand All @@ -75,10 +76,10 @@ public function processItem($data): void {
}

try {
$this->jobIndexingService->indexEntity($node);
$result = $this->jobIndexingService->indexEntity($node);
}
catch (\Exception $e) {
// Handled in service.
throw new RequeueException();
}
}

Expand Down

0 comments on commit e6fe136

Please sign in to comment.