This commit is contained in:
salam committed 2026-02-06 17:55:18 +01:00
1 parent ea049cdf22
commit 60df43f241
3 files changed
+24 -5

No files matched your search

@@ -3,6 +3,7 @@
namespace App\Console\Commands\Services\Tasks\Alarm;
use App\Models\EventBookmaker;
use PDOException;
class AlarmStore
{
@@ -42,6 +43,23 @@ class AlarmStore
}
}
EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $client_bookmaker_id)->update($update_array);
$max_tries = 5;
$tries = 0;
do {
$retry = false;
try {
$res = EventBookmaker::where('event_id', $event_id)->where('bookmaker_id', $client_bookmaker_id)->update($update_array);
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);
}
}
@@ -150,9 +150,8 @@ class NotifyAlarms
}
}
}
dd($stored_alarms);
if ($stored_alarms) {
// PersonalNotificationSend::whereNotIn('id', $stored_alarms)->delete();
PersonalNotificationSend::whereNotIn('id', $stored_alarms)->delete();
}
}
}
@@ -31,6 +31,9 @@ class TxoddsFlags
$data = Xml::load($url);
if (is_array($data)) {
Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => (int) $data['timestamp']]);
foreach ($data as $row) {
foreach ($tables as $table) {
DB::table($table)->where('offer_id', (int) $row['id'])->update(['last_updated' => $row['last_updated'], 'flags' => $row['flags']]);
@@ -47,9 +50,8 @@ class TxoddsFlags
$data = Xml::load($url);
Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => (int) $data['timestamp']]);
if (is_array($data)) {
foreach ($data as $row) {
foreach ($tables as $table) {
DB::table($table)->where('offer_id', (int) $row['id'])->update(['last_updated' => $row['last_updated'], 'flags' => $row['flags']]);