Commit 872de206 authored by clone's avatar clone

log

parent 89d6d90e
...@@ -14,13 +14,13 @@ class KillOutTimeSql{ ...@@ -14,13 +14,13 @@ class KillOutTimeSql{
public function killOutTimeSql(){ public function killOutTimeSql(){
$model = new ASite(); $model = new ASite();
$sql = "select concat('KILL ',id) as kill_sql,info from information_schema.processlist where user='tl_root' and time > 20 and db='db_tongliandichan' or db is null"; $sql = "select concat('KILL ',id) as kill_sql,info from information_schema.processlist where user='tl_root' and time > 20 and db='db_tongliandichan' or db is null";
//$sql = "select concat('KILL ',id,';') as kill_sql from information_schema.processlist where user='tldc_online' and time > 20 and db='db_tongliandichan' or db is null"; //$sql = "select concat('KILL ',id,';') as kill_sql,info from information_schema.processlist where user='tldc_online' and time > 20 and db='db_tongliandichan' or db is null";
$result = $model->query($sql); $result = $model->query($sql);
if($result){ if($result){
foreach ($result as $item){ foreach ($result as $item){
$log = "out_time_sql :" .$item["info"]; $log = "out_time_sql :" .$item["info"];
big_log($log); big_log($log);
$model->query($item["kill_sql"]); $model->execute($item["kill_sql"]);
} }
} }
......
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