StatisticFixtures prunable 5min from starttime

This commit is contained in:
salam committed 2026-08-24 12:59:36 +02:00
1 parent 269210f596
commit 8848edb3c1
3 files changed
+16 -8

No files matched your search

@@ -4,13 +4,24 @@ namespace App\Console\Commands\Grapper\Sofascore\Helper;
class Sleeper
{
public static function rand($langsam = false)
public static function rand($speed = false)
{
if ($langsam) {
switch ($speed) {
case 1:
// 5 -10 sec
$sleep = rand(5000000, 10000000);
} else {
break;
case 2:
// 10 - 20 sec
$sleep = rand(10000000, 20000000);
break;
default:
// 1 -1.5 sec
$sleep = rand(100000, 150000);
break;
}
usleep($sleep);
}
}
@@ -67,10 +67,7 @@ class Rose
SofaScoreRosa::where('id', $value->id)->update(['grapped' => 1]);
if (rand(0, 1))
Sleeper::rand(1);
else
Sleeper::rand(0);
Sleeper::rand(rand(0, 3));
}
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ class StatisticFixtures extends Model
*/
public function prunable()
{
return static::where('starttime', '<', Carbon::now('Europe/Vienna')->subMinutes(15));
return static::where('starttime', '<', Carbon::now('Europe/Vienna')->subMinutes(5));
}