From b7444b8f121c1431dd7450d67a71d3f20cbbdba9 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 25 Nov 2023 13:19:34 +0200 Subject: [PATCH] add queue offset / limit attributes --- README.md | 6 ++++-- src/cli/yggo/import.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1c11283..ed50fe9 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ php src/cli/document/search.php '@title "*"' [limit] Import index from YGGo database ``` -php src/cli/yggo/import.php 'host' 'port' 'user' 'password' 'database' [unique] +php src/cli/yggo/import.php 'host' 'port' 'user' 'password' 'database' [unique=off] [start=0] [limit=100] ``` Source DB fields required: @@ -97,4 +97,6 @@ Source DB fields required: * `user` * `password` * `database` -* `unique` - optional, check for unique URL (takes more time) \ No newline at end of file +* `unique` - optional, check for unique URL (takes more time) +* `start` - optional, offset to start queue +* `limit` - optional, limit queue \ No newline at end of file diff --git a/src/cli/yggo/import.php b/src/cli/yggo/import.php index 4b666be..a8abf00 100644 --- a/src/cli/yggo/import.php +++ b/src/cli/yggo/import.php @@ -60,8 +60,8 @@ catch (Exception $error) exit; } -$start = 0; -$limit = 100; +$start = isset($argv[7]) ? (int) $argv[7] : 0; +$limit = isset($argv[8]) ? (int) $argv[8] : 100; $total = $yggo->query('SELECT COUNT(*) AS `total` FROM `hostPage`