mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 00:29:09 +08:00
update: uniproxy
This commit is contained in:
parent
40e6400b9b
commit
f781f22cde
@ -112,7 +112,9 @@ class UniProxyController extends Controller
|
|||||||
'push_interval' => config('v2board.server_push_interval', 60),
|
'push_interval' => config('v2board.server_push_interval', 60),
|
||||||
'pull_interval' => config('v2board.server_pull_interval', 60)
|
'pull_interval' => config('v2board.server_pull_interval', 60)
|
||||||
];
|
];
|
||||||
|
if ($this->nodeInfo['route_id']) {
|
||||||
$response['routes'] = $this->serverService->getRoutes($this->nodeInfo['route_id']);
|
$response['routes'] = $this->serverService->getRoutes($this->nodeInfo['route_id']);
|
||||||
|
}
|
||||||
$eTag = sha1(json_encode($response));
|
$eTag = sha1(json_encode($response));
|
||||||
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
if (strpos($request->header('If-None-Match'), $eTag) !== false ) {
|
||||||
abort(304);
|
abort(304);
|
||||||
|
@ -218,7 +218,7 @@ class ServerService
|
|||||||
return $servers;
|
return $servers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRoutes($routeIds)
|
public function getRoutes(array $routeIds)
|
||||||
{
|
{
|
||||||
return ServerRoute::select(['id', 'match', 'action', 'action_value'])->whereIn('id', $routeIds)->get();
|
return ServerRoute::select(['id', 'match', 'action', 'action_value'])->whereIn('id', $routeIds)->get();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user