Commit 876a3b84 authored by zw's avatar zw

log

parent 99936998
......@@ -13,12 +13,14 @@ use think\console\command\make\Model;
class KillOutTimeSql{
public function killOutTimeSql(){
$model = new ASite();
$sql = "select concat('KILL ',id,';') 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";
$result = $model->query($sql);
if($result){
foreach ($result as $item){
$kill_sql = $item["kill_sql"];
$log = "out_time_sql :" .$item["info"];
big_log($log);
$model->query($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