/** * Define the application's command schedule. * * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { $schedule->command('inspire')->hourly(); $schedule->call(function () { $loader = new DataLoader(); $loader->updateMatches(); })->everyMinute(); }
private function updateResultType($n) { $matches = Match::select('id', 'team_a', 'team_b', 'winner', 'a_odds', 'b_odds', 'time', 'result_category')->orderBy('time', 'desc')->limit($n)->get(); foreach ($matches as $match) { if ($match->result_category == null or $match->result_category == "NONE") { $match->result_category = DataLoader::determineResultType($match); $match->save(); } } }
public function updatematches() { ini_set('max_execution_time', 300); $loader = new DataLoader(); $loader->updateMatches(); }