diff --git a/app/Console/Commands/Grapper/Helper/BookmakerOffer.php b/app/Console/Commands/Grapper/Helper/BookmakerOffer.php index 19c5c0e0..5b5fa3e1 100644 --- a/app/Console/Commands/Grapper/Helper/BookmakerOffer.php +++ b/app/Console/Commands/Grapper/Helper/BookmakerOffer.php @@ -18,14 +18,14 @@ class BookmakerOffer public static function init() { - if (Nuh::$options['f'] == 'bkms') { + if (Nuh::$options['fn'] == 'bkms') { self::$collector = []; } } public static function collect($bookmaker_id, $sport_id) { - if (Nuh::$options['f'] == 'bkms') { + if (Nuh::$options['fn'] == 'bkms') { if (! isset(self::$collector[$sport_id])) { self::$collector[$sport_id] = []; } @@ -38,7 +38,7 @@ class BookmakerOffer public static function finalize() { - if (Nuh::$options['f'] == 'bkms') { + if (Nuh::$options['fn'] == 'bkms') { foreach (self::$collector as $sport_id => $bookmaker_ids) { BookmakerSport::where('provider_id', Nuh::$options['provider_id']) ->where('sport_id', (int) $sport_id) diff --git a/app/Console/Commands/Nuh.php b/app/Console/Commands/Nuh.php index 296bd35b..41c43988 100644 --- a/app/Console/Commands/Nuh.php +++ b/app/Console/Commands/Nuh.php @@ -24,7 +24,7 @@ class Nuh extends Command public static $collector = []; - protected $signature = 'nuh {process=help} {--id=0} {--f=} {--p} {--d} {--x} {--t} {--w} {--g} {--a} {--r} {--s} {--t} {--q}'; + protected $signature = 'nuh {process=help} {--id=0} {--fn=} {--p} {--d} {--x} {--t} {--w} {--g} {--a} {--r} {--s} {--t} {--q} {--f}'; public function handle() { @@ -39,12 +39,13 @@ class Nuh extends Command $txt .= '----------------------------------------------'.PHP_EOL; $txt .= 'process [id] (required)'.PHP_EOL; $txt .= '--id=matchid (optional) calling spezific id'.PHP_EOL; - $txt .= '--f=name (optional) [bkms, markets]'.PHP_EOL; + $txt .= '--fn=name (optional) [bkms, markets]'.PHP_EOL; $txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL; $txt .= 'Options'.PHP_EOL; $txt .= '----------------------------------------------'.PHP_EOL; $txt .= '--p use proxy'.PHP_EOL; $txt .= '--d debug'.PHP_EOL; + $txt .= '--f run also when odd'.PHP_EOL; $txt .= '--x generate supervisors'.PHP_EOL; $txt .= '--t load today'.PHP_EOL; $txt .= '--a all by id'.PHP_EOL; diff --git a/app/Utilities/Supervisorctl.php b/app/Utilities/Supervisorctl.php index 90250085..74d63daa 100644 --- a/app/Utilities/Supervisorctl.php +++ b/app/Utilities/Supervisorctl.php @@ -16,6 +16,7 @@ class Supervisorctl $debug = $options['d'] ?? 0; $proxy = $options['p'] ?? 0; $maker = $options['x'] ?? 0; + $runanyway = $options['f'] ?? 0; // sleep for 0,5 seconds usleep(500000); @@ -54,7 +55,7 @@ class Supervisorctl } } - if (! $options['is_active']) { + if (! $options['is_active'] && ! $runanyway) { Notice::note('Process disabled, sleeps 2 min then exit', 'r'); sleep(120); exit;