Commit bf25fe83 authored by Clemens John's avatar Clemens John

Move hard coded config for crawl cycle start buffer in minutes to db config

Signed-off-by: Clemens John's avatarClemens John <clemens.john@floh1111.de>
parent 1a9f2927
......@@ -55,10 +55,10 @@ if(Permission::checkPermission(PERM_ROOT)) {
$smarty->assign('hours_to_keep_mysql_crawl_data', ConfigLine::configByName('hours_to_keep_mysql_crawl_data'));
$smarty->assign('hours_to_keep_history_table', ConfigLine::configByName('hours_to_keep_history_table'));
$smarty->assign('crawl_cycle_length_in_minutes', ConfigLine::configByName('crawl_cycle_length_in_minutes'));
$smarty->assign('crawl_cycle_start_buffer_in_minutes', ConfigLine::configByName('crawl_cycle_start_buffer_in_minutes'));
$smarty->assign('crawl_interfaces', ConfigLine::configByName('crawl_interfaces'));
$smarty->assign('crawl_range', ConfigLine::configByName('crawl_range'));
$smarty->assign('router_status_interface_whitelist', ConfigLine::configByName('router_status_interface_whitelist'));
$smarty->assign('message', Message::getMessage());
$smarty->display("header.tpl.html");
......@@ -81,6 +81,7 @@ if(Permission::checkPermission(PERM_ROOT)) {
Config::writeConfigLine('hours_to_keep_mysql_crawl_data', $_POST['hours_to_keep_mysql_crawl_data']);
Config::writeConfigLine('hours_to_keep_history_table', $_POST['hours_to_keep_history_table']);
Config::writeConfigLine('crawl_cycle_length_in_minutes', $_POST['crawl_cycle_length_in_minutes']);
Config::writeConfigLine('crawl_cycle_start_buffer_in_minutes', $_POST['crawl_cycle_start_buffer_in_minutes']);
Config::writeConfigLine('crawl_interfaces', $_POST['crawl_interfaces']);
Config::writeConfigLine('crawl_range', $_POST['crawl_range']);
Config::writeConfigLine('router_status_interface_whitelist', $_POST['router_status_interface_whitelist']);
......
......@@ -23,7 +23,8 @@
echo "Organizing crawl cycles\n";
//Get crawl cycle data
$actual_crawl_cycle = Crawling::getActualCrawlCycle();
if(empty($actual_crawl_cycle) OR strtotime($actual_crawl_cycle['crawl_date'])+(($GLOBALS['crawl_cycle']-1)*60)<=time()) {
$crawl_cycle_start_buffer = ConfigLine::configByName("crawl_cycle_start_buffer");
if(empty($actual_crawl_cycle) OR strtotime($actual_crawl_cycle['crawl_date'])+(($GLOBALS['crawl_cycle']-$crawl_cycle_start_buffer)*60)<=time()) {
echo "Create crawl data for offline routers\n";
//Set all routers in old crawl cycle that have not been crawled yet to status offline
try {
......
......@@ -7,9 +7,13 @@
<p>Stunden nach denen Crawl Daten gelöscht werden sollen:<br><input name="hours_to_keep_mysql_crawl_data" type="text" size="30" value="{$hours_to_keep_mysql_crawl_data}"></p>
<p>Stunden nach denen die History gelöscht werden soll:<br><input name="hours_to_keep_history_table" type="text" size="30" value="{$hours_to_keep_history_table}"></p>
<p>Länge eines Crawl Zyklus in Minuten:<br><input name="crawl_cycle_length_in_minutes" type="text" size="30" value="{$crawl_cycle_length_in_minutes}"></p>
<p>Puffer in Minuten in denen vom Crawl Zyklus abgewichen werden darf:<br><input name="crawl_cycle_start_buffer_in_minutes" type="text" size="30" value="{$crawl_cycle_start_buffer_in_minutes}"></p>
<p>Interfaces die gecrawled werden:<br><input name="crawl_interfaces" type="text" size="30" value="{$crawl_interfaces}"></p>
<p>Anzahl Router je Crawl-Prozess:<br><input name="crawl_range" type="text" size="30" value="{$crawl_range}"></p>
<p>Routerstatus Interface Whitelist:<br><input name="router_status_interface_whitelist" type="text" size="30" value="{$router_status_interface_whitelist}"></p>
<p><input type="submit" value="Absenden"></p>
</form>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment