소스 검색

feature: server push status

tokumeikoi 4 년 전
부모
커밋
ff30d3dcb2
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      app/Http/Controllers/Server/ShadowsocksTidalabController.php
  2. 1 1
      app/Http/Controllers/Server/TrojanTidalabController.php

+ 1 - 1
app/Http/Controllers/Server/ShadowsocksTidalabController.php

@@ -40,7 +40,6 @@ class ShadowsocksTidalabController extends Controller
             abort(500, 'fail');
         }
         Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_LAST_CHECK_AT', $server->id), time(), 3600);
-        Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_LAST_PUSH_AT', $server->id), time(), 3600);
         $serverService = new ServerService();
         $users = $serverService->getAvailableUsers(json_decode($server->group_id));
         $result = [];
@@ -71,6 +70,7 @@ class ShadowsocksTidalabController extends Controller
         $data = file_get_contents('php://input');
         $data = json_decode($data, true);
         Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_ONLINE_USER', $server->id), count($data), 3600);
+        Cache::put(CacheKey::get('SERVER_SHADOWSOCKS_LAST_PUSH_AT', $server->id), time(), 3600);
         $userService = new UserService();
         DB::beginTransaction();
         try {

+ 1 - 1
app/Http/Controllers/Server/TrojanTidalabController.php

@@ -40,7 +40,6 @@ class TrojanTidalabController extends Controller
             abort(500, 'fail');
         }
         Cache::put(CacheKey::get('SERVER_TROJAN_LAST_CHECK_AT', $server->id), time(), 3600);
-        Cache::put(CacheKey::get('SERVER_TROJAN_LAST_PUSH_AT', $server->id), time(), 3600);
         $serverService = new ServerService();
         $users = $serverService->getAvailableUsers(json_decode($server->group_id));
         $result = [];
@@ -72,6 +71,7 @@ class TrojanTidalabController extends Controller
         $data = file_get_contents('php://input');
         $data = json_decode($data, true);
         Cache::put(CacheKey::get('SERVER_TROJAN_ONLINE_USER', $server->id), count($data), 3600);
+        Cache::put(CacheKey::get('SERVER_TROJAN_LAST_PUSH_AT', $server->id), time(), 3600);
         $userService = new UserService();
         DB::beginTransaction();
         try {