Browse Source

add drop index argument

main
ghost 10 months ago
parent
commit
6a2ebab6f5
  1. 1
      README.md
  2. 24
      src/index.php

1
README.md

@ -10,3 +10,4 @@ @@ -10,3 +10,4 @@
* `cd crawler`
* `cp example/config.json config.json`
* `crontab -e`:`* * * * * php kvazar/crawler/src/index.php`
* drop index: `php kvazar/crawler/src/index.php drop`

24
src/index.php

@ -84,3 +84,27 @@ catch (Exception $exception) @@ -84,3 +84,27 @@ catch (Exception $exception)
)
);
}
// Init optional commands
if (isset($argv[1]))
{
switch ($argv[1])
{
// Drop index request
case 'drop':
$index->drop(
true
);
exit(
_('Index dropped!')
);
break;
}
}
// Begin crawler
// @TODO
Loading…
Cancel
Save