mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-27 22:54:03 +08:00
fix(connections): close conns
This commit is contained in:
parent
b7b9688c9e
commit
f3423abe92
@ -47,7 +47,7 @@ const setProxiesInfo = (proxies: (Proxy | ProxyNode)[]) => {
|
|||||||
|
|
||||||
export const useProxies = () => {
|
export const useProxies = () => {
|
||||||
const request = useRequest()
|
const request = useRequest()
|
||||||
const { activeConnectionsWithSpeed } = useConnections()
|
const { activeConnections } = useConnections()
|
||||||
|
|
||||||
const updateProxies = async () => {
|
const updateProxies = async () => {
|
||||||
const [{ providers }, { proxies }] = await Promise.all([
|
const [{ providers }, { proxies }] = await Promise.all([
|
||||||
@ -83,7 +83,7 @@ export const useProxies = () => {
|
|||||||
const proxyGroup = proxyGroupList.find((i) => i.name === proxy.name)!
|
const proxyGroup = proxyGroupList.find((i) => i.name === proxy.name)!
|
||||||
|
|
||||||
if (autoCloseConns()) {
|
if (autoCloseConns()) {
|
||||||
activeConnectionsWithSpeed().forEach(({ id, chains }) => {
|
activeConnections().forEach(({ id, chains }) => {
|
||||||
if (chains.includes(proxy.name)) {
|
if (chains.includes(proxy.name)) {
|
||||||
request.delete(`connections/${id}`)
|
request.delete(`connections/${id}`)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user