mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-30 13:31:59 +03:00
Ensured EM is closed and not cleared after running an async task
This commit is contained in:
parent
4a1e7b8d5a
commit
6eac079440
2 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ class CloseDbConnectionEventListener
|
||||||
($this->wrapped)($event);
|
($this->wrapped)($event);
|
||||||
} finally {
|
} finally {
|
||||||
$this->em->getConnection()->close();
|
$this->em->getConnection()->close();
|
||||||
$this->em->clear();
|
$this->em->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class CloseDbConnectionEventListenerTest extends TestCase
|
||||||
$close = $conn->close()->will(function (): void {
|
$close = $conn->close()->will(function (): void {
|
||||||
});
|
});
|
||||||
$getConn = $this->em->getConnection()->willReturn($conn->reveal());
|
$getConn = $this->em->getConnection()->willReturn($conn->reveal());
|
||||||
$clear = $this->em->clear()->will(function (): void {
|
$close = $this->em->close()->will(function (): void {
|
||||||
});
|
});
|
||||||
$open = $this->em->open()->will(function (): void {
|
$open = $this->em->open()->will(function (): void {
|
||||||
});
|
});
|
||||||
|
@ -51,7 +51,7 @@ class CloseDbConnectionEventListenerTest extends TestCase
|
||||||
self::assertTrue($wrappedWasCalled);
|
self::assertTrue($wrappedWasCalled);
|
||||||
$close->shouldHaveBeenCalledOnce();
|
$close->shouldHaveBeenCalledOnce();
|
||||||
$getConn->shouldHaveBeenCalledOnce();
|
$getConn->shouldHaveBeenCalledOnce();
|
||||||
$clear->shouldHaveBeenCalledOnce();
|
$close->shouldHaveBeenCalledOnce();
|
||||||
$open->shouldHaveBeenCalledOnce();
|
$open->shouldHaveBeenCalledOnce();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue