mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-27 07:34:12 +08:00
refactor(proxies): untrack msg
This commit is contained in:
parent
4ce628cec0
commit
04ccde246e
@ -1,4 +1,4 @@
|
|||||||
import { createSignal } from 'solid-js'
|
import { createSignal, untrack } from 'solid-js'
|
||||||
import {
|
import {
|
||||||
autoCloseConns,
|
autoCloseConns,
|
||||||
latencyTestTimeoutDuration,
|
latencyTestTimeoutDuration,
|
||||||
@ -94,20 +94,21 @@ export const useProxies = () => {
|
|||||||
if (autoCloseConns()) {
|
if (autoCloseConns()) {
|
||||||
// we dont use activeConns from useConnection here for better performance
|
// we dont use activeConns from useConnection here for better performance
|
||||||
// and we use empty array to restruct msg because they are closed and they won't have speed anyway
|
// and we use empty array to restruct msg because they are closed and they won't have speed anyway
|
||||||
|
untrack(() => {
|
||||||
|
const activeConns = restructRawMsgToConnection(
|
||||||
|
latestConnectionMsg()?.connections ?? [],
|
||||||
|
[],
|
||||||
|
)
|
||||||
|
|
||||||
const activeConns = restructRawMsgToConnection(
|
if (activeConns.length > 0) {
|
||||||
latestConnectionMsg()?.connections ?? [],
|
activeConns.forEach(({ id, chains }) => {
|
||||||
[],
|
if (chains.includes(proxy.name)) {
|
||||||
)
|
request.delete(`connections/${id}`)
|
||||||
|
}
|
||||||
if (activeConns.length > 0) {
|
})
|
||||||
activeConns.forEach(({ id, chains }) => {
|
mergeAllConnections(activeConns)
|
||||||
if (chains.includes(proxy.name)) {
|
}
|
||||||
request.delete(`connections/${id}`)
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
mergeAllConnections(activeConns)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proxyGroup.now = proxyName
|
proxyGroup.now = proxyName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user