get()->first(); // if process can be called only from bash if ($supervisor) { $options['sport_id'] = $supervisor->sport_id; $options['customer_id'] = $supervisor->customer_id; $options['limit'] = $supervisor->limit; if ($debug) { Notice::note('supervisor start '.self::$code, 'g'); } if ($supervisor->sleep > 0) { if (! $debug) { sleep($supervisor->sleep); } } } else { Notice::note('unknown supervisor: '.$options['code'], 'r', 1); } } public static function end($options) { $processend = microtime(true); $runtime = round(($processend - self::$starttime) / 60, 3); Supervisor::where('code', self::$code)->update(['runtime' => $runtime, 'events' => self::$events]); if ($options['d']) { Notice::note('spervisor time: '.$runtime.' min', 'g'); } } }