StatisticFixtures prunable 5min from starttime
This commit is contained in:
1 parent
269210f596
commit
8848edb3c1
3 files changed
+18
-10
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) {
|
||||
$sleep = rand(5000000, 10000000);
|
||||
} else {
|
||||
$sleep = rand(100000, 150000);
|
||||
switch ($speed) {
|
||||
case 1:
|
||||
// 5 -10 sec
|
||||
$sleep = rand(5000000, 10000000);
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user