From 33d657cb72bc39154996307e1d1a86cf43c54354 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 2 Dec 2023 15:03:51 +0200 Subject: [PATCH] apply sleep on timeout value provided only --- src/cli/document/crawl.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/cli/document/crawl.php b/src/cli/document/crawl.php index 308f4eb..6df10bf 100644 --- a/src/cli/document/crawl.php +++ b/src/cli/document/crawl.php @@ -581,9 +581,12 @@ foreach($search->get() as $document) ); // Delay next attempt - sleep( - $ftp->connection->attempts->delay - ); + if ($ftp->connection->attempts->delay) + { + sleep( + $ftp->connection->attempts->delay + ); + } } } while ($connection === false); @@ -605,7 +608,10 @@ foreach($search->get() as $document) } // Crawl queue delay - sleep( - $config->cli->document->crawl->queue->limit - ); + if ($config->cli->document->crawl->queue->limit) + { + sleep( + $config->cli->document->crawl->queue->limit + ); + } } \ No newline at end of file