Skip to content

Commit

Permalink
Fixed removing file when entity manager is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
tg666 committed Aug 7, 2024
1 parent 93d2c55 commit 4170749
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/EventSubscriber/DeleteFileSourceEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public function postFlush(PostFlushEventArgs $args): void
return;
}

if (!$args->getEntityManager()->isOpen()) {
$this->queue = new SplQueue();

return;
}

while (!$this->queue->isEmpty()) {
/** @var \SixtyEightPublishers\FileBundle\Entity\FileInterface $file */
$file = $this->queue->dequeue();
Expand Down

0 comments on commit 4170749

Please sign in to comment.