save updates

This commit is contained in:
salam committed 2026-02-07 07:08:58 +01:00
1 parent 3671902fe7
commit 046407df18
36 files changed
+261 -305

No files matched your search

@@ -5,8 +5,8 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread;
use App\Console\Commands\Nuh;
use App\Models\OddsPointQ1;
use App\Utilities\DatabaseFunctions;
use App\Utilities\Margin;
use PDOException;
class _PointsQ1
{
@@ -41,24 +41,8 @@ class _PointsQ1
$res->flags = 1;
$res->margin = $odds['margin'];
$max_tries = 5;
$tries = 0;
do {
$retry = false;
try {
DatabaseFunctions::save_update($res);
$res->save();
return $res;
} catch (PDOException $exc) {
if ($tries < $max_tries && $exc->errorInfo[0] == 40001 && $exc->errorInfo[1] == 1213) {
$retry = true;
sleep(1);
} else {
throw $exc;
}
}
} while ($retry);
}
ActiveSpread::collect($odds, 'odds_points_q1');