Skip to content

Commit c13f35c

Browse files
authored
Allow JobStorage to reset the EntityManager
After a Job triggers a Doctrine exception, and handles it, the EntityManager still remains closed and JobStorage can't persist changes. This fix resets the Manager after such an occurrence.
1 parent 7081bfa commit c13f35c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/job-queue/Doctrine/JobStorage.php

+3
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ private function getEntityManager()
212212
if (!$this->em) {
213213
$this->em = $this->doctrine->getManagerForClass($this->entityClass);
214214
}
215+
if (!$this->em->isOpen()) {
216+
$this->em = $this->doctrine->resetManager();
217+
}
215218

216219
return $this->em;
217220
}

0 commit comments

Comments
 (0)