From 9f23a0ebe4fc05f2840005ac9e676da4747b0d09 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 30 Jul 2023 22:05:37 +0300 Subject: [PATCH] move clean/crawl commans to the crontab options --- README.md | 5 +++-- cli/yggo.php | 34 +++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9b9c388..6f6a140 100644 --- a/README.md +++ b/README.md @@ -223,8 +223,9 @@ GET m=SphinxQL ##### CLI * [x] help -* [x] crawl -* [x] clean +* [x] crontab + * [x] crawl + * [x] clean * [x] hostPageSnap + [x] repair + [x] _sync DB-FS relations_ diff --git a/cli/yggo.php b/cli/yggo.php index b84c2a1..7b4b8fe 100644 --- a/cli/yggo.php +++ b/cli/yggo.php @@ -54,21 +54,34 @@ if (empty($argv[1])) $argv[1] = 'help'; switch ($argv[1]) { - case 'crawl': + case 'crontab': - CLI::notice(_('crawler queue step begin...')); + if (empty($argv[2])) { - include_once(__DIR__ . '/../crontab/crawler.php'); + CLI::danger(_('crontab method requires action argument')); - CLI::notice(_('crawler queue step begin...')); - break; - case 'clean': + switch ($argv[2]) { + + case 'crawl': + + CLI::notice(_('crawler queue step begin...')); + + include_once(__DIR__ . '/../crontab/crawler.php'); - CLI::notice(_('cleaner queue step begin...')); + CLI::notice(_('crawler queue step begin...')); + break; - include_once(__DIR__ . '/../crontab/cleaner.php'); + case 'clean': - CLI::notice(_('cleaner queue step completed.')); + CLI::notice(_('cleaner queue step begin...')); + + include_once(__DIR__ . '/../crontab/cleaner.php'); + + CLI::notice(_('cleaner queue step completed.')); + + break; + } + } break; case 'hostPageSnap': @@ -423,8 +436,7 @@ CLI::break(); CLI::default('available options:'); CLI::default(' help - this message'); -CLI::default(' crawl - execute crawler step in the crontab queue'); -CLI::default(' clean - execute cleaner step in the crontab queue'); +CLI::default(' crontab [crawl|clean] - execute crontab script queue'); CLI::default(' hostPage rank reindex - generate rank indexes in hostPage table'); CLI::default(' hostPageSnap repair - sync DB/FS relations'); CLI::default(' hostPageDom generate [selectors] - make hostPageDom index based on related hostPage.data field');