update trojan server

This commit is contained in:
Tokumeikoi 2020-06-11 21:50:18 +08:00
parent 747a3c5c06
commit a1ae4caee3
2 changed files with 5 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class TrojanTidalabController extends Controller
if (!$server) {
abort(500, 'fail');
}
Cache::put(CacheKey::get('SERVER_LAST_CHECK_AT', $server->id), time(), 3600);
Cache::put(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server->id), time(), 3600);
$serverService = new ServerService();
$users = $serverService->getAvailableUsers(json_decode($server->group_id));
$result = [];
@ -69,7 +69,7 @@ class TrojanTidalabController extends Controller
}
$data = file_get_contents('php://input');
$data = json_decode($data, true);
Cache::put(CacheKey::get('SERVER_ONLINE_USER', $server->id), count($data), 3600);
Cache::put(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $server->id), count($data), 3600);
$serverService = new ServerService();
$userService = new UserService();
foreach ($data as $item) {

View File

@ -8,7 +8,9 @@ class CacheKey
'EMAIL_VERIFY_CODE' => '邮箱验证吗',
'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间',
'SERVER_ONLINE_USER' => '节点在线用户',
'SERVER_LAST_CHECK_AT' => '节点最后检查时间'
'SERVER_LAST_CHECK_AT' => '节点最后检查时间',
'SERVER_TROJAN_ONLINE_USER' => 'trojan节点在线用户',
'SERVER_TROJAN_LAST_CHECK_AT' => 'trojan节点最后检查时间'
];
public static function get(string $key, $uniqueValue)