From 01753b0557d0da2c7288120e6d308f2be86fe06b Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 20 Nov 2023 00:06:17 +0200 Subject: [PATCH] add crawl queue delay support --- src/cli/document/crawl.php | 5 +++++ src/config.json | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli/document/crawl.php b/src/cli/document/crawl.php index 856ecdb..62b9ed0 100644 --- a/src/cli/document/crawl.php +++ b/src/cli/document/crawl.php @@ -273,4 +273,9 @@ foreach($search->get() as $document) } } } + + // Apply delay + sleep( + $config->cli->document->crawl->queue->limit + ); } \ No newline at end of file diff --git a/src/config.json b/src/config.json index 4dbc2a7..cdf9a3f 100644 --- a/src/config.json +++ b/src/config.json @@ -19,7 +19,8 @@ { "queue": { - "limit":1 + "limit":1, + "delay":1 }, "selector": {