1.修正数据库高负载BUG(杜若)

2.优化queue.sh脚本(vft9nesd)
This commit is contained in:
admin
2019-02-14 10:01:32 +08:00
parent 741b4b8c3b
commit 1788f82b79
6 changed files with 20 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ use App\Http\Models\SsNodeTrafficHourly;
use App\Http\Models\SsNodeTrafficDaily;
use App\Http\Models\UserBanLog;
use App\Http\Models\UserLoginLog;
use App\Http\Models\UserSubscribeLog;
use App\Http\Models\UserTrafficDaily;
use App\Http\Models\UserTrafficLog;
use App\Http\Models\UserTrafficHourly;
@@ -75,6 +76,9 @@ class AutoClearLog extends Command
// 自动清除3个月以前用户登陆日志
UserLoginLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-3 month")))->delete();
// 自动清除1个月前的用户订阅记录
UserSubscribeLog::query()->where('request_time', '<=', date('Y-m-d H:i:s', strtotime("-1 month")))->delete();
}
}

View File

@@ -77,7 +77,7 @@ class AuthController extends Controller
if (Auth::user()->status < 0) {
Session::flash('errorMsg', '账号已禁用');
Auth::logout(); // 强制退出会话因为Auth::attempt的时候会产生会话
Auth::logout(); // 强制销毁会话因为Auth::attempt的时候会产生会话
return Redirect::back()->withInput();
}
@@ -85,7 +85,7 @@ class AuthController extends Controller
if (Auth::user()->status == 0 && self::$systemConfig['is_active_register']) {
Session::flash('errorMsg', '账号未激活,请点击<a href="/activeUser?username=' . Auth::user()->username . '" target="_blank"><span style="color:#000">【激活账号】</span></a>');
Auth::logout(); // 强制退出会话因为Auth::attempt的时候会产生会话
Auth::logout(); // 强制销毁会话因为Auth::attempt的时候会产生会话
return Redirect::back()->withInput();
}

View File

@@ -1,2 +1,9 @@
#!/bin/bash
nohup php artisan queue:work database --queue=default --timeout=60 --sleep=5 --tries=3 >> ./storage/logs/queue.log 2>&1 &
ps -ef | grep queue:work | grep -v grep
if [ $? -ne 0 ]
then
echo "start queue process successfully....."
nohup php artisan queue:work database --queue=default --timeout=60 --sleep=5 --tries=3 >> ./storage/logs/queue.log 2>&1 &
else
echo "queue is running....."
fi

View File

@@ -2,3 +2,8 @@
ALTER TABLE `user`
CHANGE COLUMN `speed_limit_per_con` `speed_limit_per_con` BIGINT NOT NULL DEFAULT '10737418240' COMMENT '单连接限速默认10M为0表示不限速单位Byte' AFTER `obfs_param`,
CHANGE COLUMN `speed_limit_per_user` `speed_limit_per_user` BIGINT NOT NULL DEFAULT '10737418240' COMMENT '单用户限速默认10M为0表示不限速单位Byte' AFTER `speed_limit_per_con`;
-- 优化数据库,防止暴库
ALTER TABLE `user_subscribe_log`
ADD INDEX `sid` (`sid`);

View File

@@ -1,2 +1,3 @@
*
*
!.gitignore

Binary file not shown.