diff --git a/CHANGELOG.md b/CHANGELOG.md index 441218f6..53d4637d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,12 +18,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this ### Removed * [#1275](https://github.com/shlinkio/shlink/issues/1275) Removed everything that was deprecated. - See [UPGRADE](UPGRADE.md#from-v2x-to-v3x) doc in order to get details on how to migrate to this version. + See [UPGRADE](UPGRADE.md#from-v2x-to-v3x) doc in order to get details on how to migrate to this version. ### Fixed * *Nothing* +## [2.10.1] - 2021-12-21 +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* [#1285](https://github.com/shlinkio/shlink/issues/1285) Fixed error caused by database connections expiring after some hours of inactivity. +* [#1286](https://github.com/shlinkio/shlink/issues/1286) Fixed `x-request-id` header not being generated during non-rest requests. + + ## [2.10.0] - 2021-12-12 ### Added * [#1163](https://github.com/shlinkio/shlink/issues/1163) Allowed setting not-found redirects for default domain in the same way it's done for any other domain. diff --git a/composer.json b/composer.json index 3f8f256e..df0f5308 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "predis/predis": "^1.1", "pugx/shortid-php": "^1.0", "ramsey/uuid": "^4.2", - "shlinkio/shlink-common": "^4.2", + "shlinkio/shlink-common": "^4.2.1", "shlinkio/shlink-config": "^1.4", "shlinkio/shlink-event-dispatcher": "^2.3", "shlinkio/shlink-importer": "^2.5", diff --git a/config/autoload/middleware-pipeline.global.php b/config/autoload/middleware-pipeline.global.php index becd3ad3..c628c4fd 100644 --- a/config/autoload/middleware-pipeline.global.php +++ b/config/autoload/middleware-pipeline.global.php @@ -17,6 +17,7 @@ return [ 'error-handler' => [ 'middleware' => [ ContentLengthMiddleware::class, + RequestIdMiddleware::class, ErrorHandler::class, Rest\Middleware\CrossDomainMiddleware::class, ], @@ -24,7 +25,6 @@ return [ 'error-handler-rest' => [ 'path' => '/rest', 'middleware' => [ - RequestIdMiddleware::class, ProblemDetails\ProblemDetailsMiddleware::class, ], ], diff --git a/config/autoload/swoole.global.php b/config/autoload/swoole.global.php index ad4e3792..f7159ed7 100644 --- a/config/autoload/swoole.global.php +++ b/config/autoload/swoole.global.php @@ -22,7 +22,7 @@ return (static function () { 'options' => [ 'worker_num' => (int) env('WEB_WORKER_NUM', 16), - 'task_worker_num' => $taskWorkers < MIN_TASK_WORKERS ? MIN_TASK_WORKERS : $taskWorkers, + 'task_worker_num' => max($taskWorkers, MIN_TASK_WORKERS), ], ], ], diff --git a/module/Core/src/EventDispatcher/CloseDbConnectionEventListener.php b/module/Core/src/EventDispatcher/CloseDbConnectionEventListener.php index 079c6195..985b13c2 100644 --- a/module/Core/src/EventDispatcher/CloseDbConnectionEventListener.php +++ b/module/Core/src/EventDispatcher/CloseDbConnectionEventListener.php @@ -24,7 +24,7 @@ class CloseDbConnectionEventListener ($this->wrapped)($event); } finally { $this->em->getConnection()->close(); - $this->em->clear(); + $this->em->close(); } } } diff --git a/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php b/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php index 3d830cf3..d0c7c374 100644 --- a/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php +++ b/module/Core/test/EventDispatcher/CloseDbConnectionEventListenerTest.php @@ -35,7 +35,7 @@ class CloseDbConnectionEventListenerTest extends TestCase $close = $conn->close()->will(function (): void { }); $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 { }); @@ -51,7 +51,7 @@ class CloseDbConnectionEventListenerTest extends TestCase self::assertTrue($wrappedWasCalled); $close->shouldHaveBeenCalledOnce(); $getConn->shouldHaveBeenCalledOnce(); - $clear->shouldHaveBeenCalledOnce(); + $close->shouldHaveBeenCalledOnce(); $open->shouldHaveBeenCalledOnce(); }