0 ) { $horaAnterior = substr($executeDate, 11,2); //obtém a hora de execução da GCron } else { $horaAnterior = ''; } while(true) { file_put_contents($tmpPath . 'gcron.log', date('d/m/Y H:i:s')); //grava o log de execução $hour = date('H'); if ( $horaAnterior != $hour ) { exec("php {$path}/runScheduleTasks.php"); //thread que executa as tarefas $horaAnterior = $hour; } updateTable(); //executa a atualização da tabela de pesquisa //executa a GCron somente uma vez if ( $pSemWhile ) { break; } sleep(SLEEP_TIME); //aguarda 30 segundos } ?>