Browse Source

Merge pull request #25 from discoverygarden/SUP-6725

SUP-6725: Hardening fixity
pull/22/merge v1.3.2
lutaylor 4 months ago committed by GitHub
parent
commit
6d7b8738e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      src/Plugin/QueueWorker/FixityCheckWorker.php

8
src/Plugin/QueueWorker/FixityCheckWorker.php

@ -6,6 +6,7 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\dgi_fixity\FixityCheckInterface;
use Drupal\dgi_fixity\FixityCheckServiceInterface;
use Drupal\file\FileInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
@ -61,7 +62,12 @@ class FixityCheckWorker extends QueueWorkerBase implements ContainerFactoryPlugi
public function processItem($data) {
if ($data instanceof FixityCheckInterface) {
/** @var \Drupal\dgi_fixity\FixityCheckInterface $data */
$this->fixity->check($data->getFile());
if ($data->getFile() instanceof FileInterface) {
$this->fixity->check($data->getFile());
}
else {
$data->setState(FixityCheckInterface::STATE_MISSING);
}
}
}

Loading…
Cancel
Save