Handler fix

This commit is contained in:
magnolia-fan
2011-04-04 21:34:53 +04:00
parent 97dd496c74
commit 77bb597609
2 changed files with 5 additions and 49 deletions
+5 -4
View File
@@ -1,8 +1,9 @@
#!/opt/local/bin/php
<?php
chdir('../..');
require_once 'common.php';
define('APPDIR', '/www/server/php/');
require_once APPDIR .'common.php';
$tmp = array_slice(scandir(Config::get('app:Parser:bot_stats_dir')), 2);
$bots = array();
@@ -28,14 +29,14 @@ switch ($argv[1]) {
echo $bot_name ." is working already\n";
} else {
echo "Launching ". $bot_name ."\n";
shell_exec("./worker_html_grabber.php ". $bot_name ." > /www/parser_data/log/". $bot_name .".log &");
shell_exec(APPDIR ."bin/parser/worker_html_grabber.php ". $bot_name ." > /www/parser_data/log/". $bot_name .".log &");
}
} else {
$bots = custom_shuffle($bots);
foreach ($bots as $name => $bot) {
if (!$bot->active) {
echo "Launching ". $name ."\n";
shell_exec("./worker_html_grabber.php ". $name ." > /www/parser_data/log/". $name .".log &");
shell_exec("bin/parser/worker_html_grabber.php ". $name ." > /www/parser_data/log/". $name .".log &");
die;
}
}