From 8692732581fd860c2f32d9e151edae74ec7a131a Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Thu, 28 Sep 2017 17:26:27 +0200 Subject: [PATCH] refactor(upload): defer parse of applications --- inc/package.class.php | 16 ++++++++++++++++ install/installer.class.php | 8 ++++---- tools/cli_install.php | 0 3 files changed, 20 insertions(+), 4 deletions(-) mode change 100755 => 100644 tools/cli_install.php diff --git a/inc/package.class.php b/inc/package.class.php index cb61fcb3..b3afc950 100644 --- a/inc/package.class.php +++ b/inc/package.class.php @@ -540,6 +540,22 @@ protected function sendFile() { exit(0); } + /** + * get Cron description parameter for this class + * + * @param $name string name of the task + * + * @return array of string + **/ + static function cronInfo($name) { + + switch ($name) { + case 'ParseApplication' : + return array('description' => __('Parse an application to find metadata')); + } + } + + /** * Launch parsing of applciation files * diff --git a/install/installer.class.php b/install/installer.class.php index 03c85a65..d7dc120f 100644 --- a/install/installer.class.php +++ b/install/installer.class.php @@ -507,13 +507,13 @@ protected function upgradeOneStep($toVersion) { protected function createJobs() { CronTask::Register(PluginFlyvemdmMqttupdatequeue::class, 'UpdateTopics', MINUTE_TIMESTAMP, [ - 'comment' => __('Update retained MQTT topics for fleet policies', 'flyvemdm'), - 'mode' => CronTask::MODE_EXTERNAL + 'comment' => __('Update retained MQTT topics for fleet policies', 'flyvemdm'), + 'mode' => CronTask::MODE_EXTERNAL ]); - CronTask::Register(PluginFlyvemdmPackage::class, 'ParseApplication', MINUTE_TIMESTAMP, + CronTask::Register(PluginFlyvemdmPackage::class, 'AnalyzeApplication', MINUTE_TIMESTAMP, [ - 'comment' => __('Parse uploaded applications', 'flyvemdm'), + 'comment' => __('Analyze uploaded applications', 'flyvemdm'), 'mode' => CronTask::MODE_EXTERNAL ]); } diff --git a/tools/cli_install.php b/tools/cli_install.php old mode 100755 new mode 100644