Commit f71f0b1e authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Wenn keine Redis-Verbindung zum Logs-Server aufgebaut werden kann, stürzt das Skript nicht mehr ab

parent 17444e92
......@@ -152,7 +152,7 @@ class MetaGer
private function createLogs()
{
$redis = Redis::connection('redisLogs');
if( $redis )
try
{
$logEntry = "";
$logEntry .= "[" . date(DATE_RFC822, mktime(date("H"),date("i"), date("s"), date("m"), date("d"), date("Y"))) . "]";
......@@ -176,6 +176,9 @@ class MetaGer
$logEntry .= " iter= mm= time=" . round((microtime(true)-$this->starttime), 2) . " serv=" . $this->fokus . " which= hits= stringSearch= QuickTips= SSS= check=";
$logEntry .= " search=" . $this->eingabe;
$redis->rpush('logs.search', $logEntry);
}catch( \Exception $e)
{
return;
}
}
......
......@@ -28,7 +28,10 @@ class AppServiceProvider extends ServiceProvider
$today = strtotime(date(DATE_RFC822, mktime(0,0,0, date("m"), date("d"), date("Y"))));
$end = strtotime(date(DATE_RFC822, mktime(date("H"),date("i"), date("s"), date("m"), date("d"), date("Y")))) - $today;
$expireAt = strtotime(date(DATE_RFC822, mktime(0,0,0, date("m"), date("d")+1, date("Y"))));
try{
$redis = Redis::connection('redisLogs');
if( !$redis )
return;
$p = getmypid();
$host = gethostname();
$begin = $this->begin - $today;
......@@ -47,6 +50,10 @@ class AppServiceProvider extends ServiceProvider
}
}
});
}catch( \Exception $e)
{
return;
}
});
}
......
Supports Markdown
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