mirror of
https://github.com/kvazar-network/crawler.git
synced 2025-09-08 13:01:56 +00:00
fix delay argument
This commit is contained in:
parent
ae39cf2a6e
commit
116cce4fb7
@ -107,6 +107,9 @@ catch (Exception $exception)
|
||||
);
|
||||
}
|
||||
|
||||
// Default crawl delay in seconds
|
||||
$delay = 60;
|
||||
|
||||
// Init optional commands
|
||||
if (isset($argv[1]))
|
||||
{
|
||||
@ -140,12 +143,18 @@ if (isset($argv[1]))
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
// Is valid crawl delay?
|
||||
$seconds = (int) $argv[1];
|
||||
|
||||
if ($seconds > 1) {
|
||||
$delay = $seconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Init crawl delay from argument or use default value
|
||||
$delay = empty($argv[0]) ? 60 : (int) $argv[0];
|
||||
|
||||
// Begin crawler
|
||||
while (true)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user