8000 [5.4] fix: stop worker if a database disconnection occured by Broutard · Pull Request #19080 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[5.4] fix: stop worker if a database disconnection occured #19080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 8, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Worker.php
fix: styleCI
  • Loading branch information
Broutard authored May 5, 2017
commit ef44535e3a26af29b2cbe29577df6af240aa6b20
10 changes: 5 additions & 5 deletions src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

use Exception;
use Throwable;
use Illuminate\Database\QueryException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\DetectsLostConnections;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Illuminate\Contracts\Cache\Repository as CacheContract;
use Illuminate\Database\QueryException;
use Illuminate\Database\DetectsLostConnections;

class Worker
{
Expand Down Expand Up @@ -277,11 +277,11 @@ protected function runJob($job, $connectionName, WorkerOptions $options)
* @param \Exception $e
* @return void
*/
protected function handleDatabaseException($e) {
protected function handleDatabaseException($e)
{
if ($e instanceof QueryException && $this->causedByLostConnection($e->getPrevious())) {
$this->stop(1);
}
elseif ($this->causedByLostConnection($e)) {
} elseif ($this->causedByLostConnection($e)) {
$this->stop(1);
}
}
Expand Down
0