diff --git a/application/controllers/Clublog.php b/application/controllers/Clublog.php index fda11c997..e40b9fd1e 100644 --- a/application/controllers/Clublog.php +++ b/application/controllers/Clublog.php @@ -26,7 +26,7 @@ class Clublog extends CI_Controller { $this->load->model('clublog_model'); $this->load->model('cron_model'); - $this->cron_model->set_last_run('upload_clublog'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $users = $this->clublog_model->get_clublog_users(); diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index f1296bdc8..e801b1366 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -715,7 +715,8 @@ class eqsl extends CI_Controller { public function sync() { $this->load->model('cron_model'); - $this->cron_model->set_last_run('sync_eqsl'); + $this->load->model('cron_model'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); ini_set('memory_limit', '-1'); set_time_limit(0); diff --git a/application/controllers/Hrdlog.php b/application/controllers/Hrdlog.php index a8bfdc299..b798c963e 100644 --- a/application/controllers/Hrdlog.php +++ b/application/controllers/Hrdlog.php @@ -26,7 +26,7 @@ class Hrdlog extends CI_Controller { $this->setOptions(); $this->load->model('cron_model'); - $this->cron_model->set_last_run('upload_hrd'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $this->load->model('logbook_model'); diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 5115b98af..c5cbfd0e5 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -199,7 +199,7 @@ class Lotw extends CI_Controller { } $this->load->model('cron_model'); - $this->cron_model->set_last_run('upload_lotw'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); // Get Station Profile Data $this->load->model('Stations'); diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index d2950eae2..446b0208c 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -30,7 +30,7 @@ class Qrz extends CI_Controller { $this->setOptions(); $this->load->model('cron_model'); - $this->cron_model->set_last_run('upload_qrz'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $this->load->model('logbook_model'); @@ -216,7 +216,7 @@ class Qrz extends CI_Controller { $this->load->model('logbook_model'); $this->load->model('cron_model'); - $this->cron_model->set_last_run('download_qrz'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $api_keys = $this->logbook_model->get_qrz_apikeys(); diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 5ba19f067..e6189c9ff 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -307,7 +307,7 @@ class Update extends CI_Controller { public function update_clublog_scp() { $this->load->model('cron_model'); - $this->cron_model->set_last_run('clublog_scp'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $strFile = $this->make_update_path("clublog_scp.txt"); $url = "https://cdn.clublog.org/clublog.scp.gz"; @@ -361,7 +361,7 @@ class Update extends CI_Controller { public function lotw_users() { $this->load->model('cron_model'); - $this->cron_model->set_last_run('lotw_activity'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $mtime = microtime(); $mtime = explode(" ",$mtime); @@ -425,7 +425,7 @@ class Update extends CI_Controller { public function update_dok() { $this->load->model('cron_model'); - $this->cron_model->set_last_run('update_dok'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $contents = file_get_contents('https://www.df2et.de/cqrlog/dok_and_sdok.txt', true); @@ -457,7 +457,7 @@ class Update extends CI_Controller { public function update_sota() { $this->load->model('cron_model'); - $this->cron_model->set_last_run('update_sota'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $csvfile = 'https://www.sotadata.org.uk/summitslist.csv'; @@ -507,7 +507,7 @@ class Update extends CI_Controller { public function update_wwff() { $this->load->model('cron_model'); - $this->cron_model->set_last_run('update_wwff'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $csvfile = 'https://wwff.co/wwff-data/wwff_directory.csv'; @@ -558,7 +558,7 @@ class Update extends CI_Controller { public function update_pota() { $this->load->model('cron_model'); - $this->cron_model->set_last_run('update_pota'); + $this->cron_model->set_last_run($this->router->class.'_'.$this->router->method); $csvfile = 'https://pota.app/all_parks.csv'; diff --git a/application/migrations/196_cron_table.php b/application/migrations/196_cron_table.php index 345e7e9ce..66101b580 100644 --- a/application/migrations/196_cron_table.php +++ b/application/migrations/196_cron_table.php @@ -58,18 +58,18 @@ class Migration_cron_table extends CI_Migration { $this->dbforge->create_table('cron'); $data = array( - array('id' => 'upload_clublog', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to Clublog', 'function' => 'index.php/clublog/upload', 'expression' => '3 */6 * * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'upload_lotw', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to LoTW', 'function' => 'index.php/lotw/lotw_upload', 'expression' => '0 */1 * * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'upload_qrz', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to QRZ', 'function' => 'index.php/qrz/upload', 'expression' => '6 */6 * * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'download_qrz', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Download QSOs from QRZ', 'function' => 'index.php/qrz/download', 'expression' => '18 */6 * * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'upload_hrd', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to HRD', 'function' => 'index.php/hrdlog/upload', 'expression' => '12 */6 * * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'sync_eqsl', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload/download QSOs to/from Eqsl', 'function' => 'index.php/eqsl/sync', 'expression' => '9 */6 * * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'lotw_activity', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update LOTW Users Activity', 'function' => 'index.php/update/lotw_users', 'expression' => '10 1 * * 1', 'last_run' => null, 'next_run' => null ), - array('id' => 'clublog_scp', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update Clublog SCP Database File', 'function' => 'index.php/update/update_clublog_scp', 'expression' => '0 0 * * 0', 'last_run' => null, 'next_run' => null ), - array('id' => 'update_dok', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update DOK File', 'function' => 'index.php/update/update_dok', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'update_sota', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update SOTA File', 'function' => 'index.php/update/update_sota', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'update_wwff', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update WWFF File', 'function' => 'index.php/update/update_wwff', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), - array('id' => 'update_pota', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update POTA File', 'function' => 'index.php/update/update_pota', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'clublog_upload', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to Clublog', 'function' => 'index.php/clublog/upload', 'expression' => '3 */6 * * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'lotw_lotw_upload', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to LoTW', 'function' => 'index.php/lotw/lotw_upload', 'expression' => '0 */1 * * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'qrz_upload', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to QRZ', 'function' => 'index.php/qrz/upload', 'expression' => '6 */6 * * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'qrz_download', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Download QSOs from QRZ', 'function' => 'index.php/qrz/download', 'expression' => '18 */6 * * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'hrdlog_upload', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload QSOs to HRD', 'function' => 'index.php/hrdlog/upload', 'expression' => '12 */6 * * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'eqsl_sync', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Upload/download QSOs to/from Eqsl', 'function' => 'index.php/eqsl/sync', 'expression' => '9 */6 * * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'update_lotw_users', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update LOTW Users Activity', 'function' => 'index.php/update/lotw_users', 'expression' => '10 1 * * 1', 'last_run' => null, 'next_run' => null ), + array('id' => 'update_update_clublog_scp', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update Clublog SCP Database File', 'function' => 'index.php/update/update_clublog_scp', 'expression' => '0 0 * * 0', 'last_run' => null, 'next_run' => null ), + array('id' => 'update_update_dok', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update DOK File', 'function' => 'index.php/update/update_dok', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'update_update_sota', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update SOTA File', 'function' => 'index.php/update/update_sota', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'update_update_wwff', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update WWFF File', 'function' => 'index.php/update/update_wwff', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), + array('id' => 'update_update_pota', 'enabled' => '1', 'status' => 'healthy', 'description' => 'Update POTA File', 'function' => 'index.php/update/update_pota', 'expression' => '0 0 1 * *', 'last_run' => null, 'next_run' => null ), ); $this->db->insert_batch('cron', $data);