mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Close connections after every async job that uses the db
This commit is contained in:
@@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
||||
* *Nothing*
|
||||
|
||||
### Fixed
|
||||
* *Nothing*
|
||||
* [#2341](https://github.com/shlinkio/shlink/issues/2341) Ensure all asynchronous jobs that interact with the database do not leave idle connections open.
|
||||
|
||||
|
||||
# [4.4.0] - 2024-12-27
|
||||
|
||||
@@ -73,6 +73,9 @@ return (static function (): array {
|
||||
],
|
||||
|
||||
'delegators' => [
|
||||
EventDispatcher\Matomo\SendVisitToMatomo::class => [
|
||||
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
||||
],
|
||||
EventDispatcher\Mercure\NotifyVisitToMercure::class => [
|
||||
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
||||
],
|
||||
@@ -94,6 +97,9 @@ return (static function (): array {
|
||||
EventDispatcher\LocateUnlocatedVisits::class => [
|
||||
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
||||
],
|
||||
EventDispatcher\UpdateGeoLiteDb::class => [
|
||||
EventDispatcher\CloseDbConnectionEventListenerDelegator::class,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class CloseDbConnectionEventListener
|
||||
/** @var callable */
|
||||
private $wrapped;
|
||||
|
||||
public function __construct(private ReopeningEntityManagerInterface $em, callable $wrapped)
|
||||
public function __construct(private readonly ReopeningEntityManagerInterface $em, callable $wrapped)
|
||||
{
|
||||
$this->wrapped = $wrapped;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user