From 2f02d61fddcbd8f70d2b1c5aa9b6abdee247c31a Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 27 Feb 2026 09:52:40 +0100 Subject: [PATCH] ActiveSpread add tranaction catch deadlock --- .../Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php b/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php index 5fc6d400..84ed20f4 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/Tools/ActiveSpread.php @@ -37,7 +37,9 @@ class ActiveSpread { foreach (self::$collector as $table => $value) { - DB::table($table)->where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->update(['active_spread' => 0]); + DB::transaction(function () use ($table, $event_id, $bookmaker_id) { + DB::table($table)->where('event_id', $event_id)->where('bookmaker_id', $bookmaker_id)->update(['active_spread' => 0]); + }, 5); if (in_array($table, ['odds_points', 'odds_points_ht', 'odds_points_q1'])) {