mirror of
https://github.com/win32service/Win32ServiceBundle.git
synced 2026-03-24 01:02:16 +01:00
use RecoveryActionException to request Mesenger consumer restart
This commit is contained in:
@@ -48,6 +48,9 @@
|
||||
"doctrine/orm": "^2.19",
|
||||
"phpunit/phpunit": "^9.6"
|
||||
},
|
||||
"conflict": {
|
||||
"win32service/service-library": "<1.0.2"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-win32service": "On Windows only, install this extension to run PHP Service on Windows Service Manager"
|
||||
},
|
||||
|
||||
@@ -20,6 +20,7 @@ use Symfony\Component\Messenger\Stamp\FlushBatchHandlersStamp;
|
||||
use Symfony\Component\Messenger\Stamp\NoAutoAckStamp;
|
||||
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
|
||||
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
|
||||
use Win32Service\Exception\RecoveryActionException;
|
||||
use Win32Service\Model\AbstractServiceRunner;
|
||||
use Win32ServiceBundle\Event\MessengerWorkerMessageFailedEvent;
|
||||
use Win32ServiceBundle\Event\MessengerWorkerMessageHandledEvent;
|
||||
@@ -106,6 +107,8 @@ final class MessengerServiceRunner extends AbstractServiceRunner
|
||||
|
||||
$this->shouldStop = true;
|
||||
$this->requestStop();
|
||||
|
||||
throw new RecoveryActionException('Restart requested');
|
||||
}
|
||||
|
||||
protected function beforeContinue(): void
|
||||
|
||||
Reference in New Issue
Block a user