Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

DetectsDeadlocks.php 891B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Illuminate\Database;
  3. use Exception;
  4. use Illuminate\Support\Str;
  5. trait DetectsDeadlocks
  6. {
  7. /**
  8. * Determine if the given exception was caused by a deadlock.
  9. *
  10. * @param \Exception $e
  11. * @return bool
  12. */
  13. protected function causedByDeadlock(Exception $e)
  14. {
  15. $message = $e->getMessage();
  16. return Str::contains($message, [
  17. 'Deadlock found when trying to get lock',
  18. 'deadlock detected',
  19. 'The database file is locked',
  20. 'database is locked',
  21. 'database table is locked',
  22. 'A table in the database is locked',
  23. 'has been chosen as the deadlock victim',
  24. 'Lock wait timeout exceeded; try restarting transaction',
  25. 'WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction',
  26. ]);
  27. }
  28. }