Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback) |
||
25 | { |
||
26 | // https://github.com/swoole/swoole-src/blob/a414e5e8fec580abb3dbd772d483e12976da708f/swoole_mysql_coro.c#L1140 |
||
27 | if ($this->causedByLostConnection($e->getPrevious()) || Str::contains( |
||
28 | $e->getMessage(), |
||
29 | ['is closed', 'is not established'] |
||
30 | )) { |
||
31 | $this->reconnect(); |
||
32 | |||
33 | return $this->runQueryCallback($query, $bindings, $callback); |
||
34 | } |
||
35 | |||
36 | throw $e; |
||
37 | } |
||
39 |