Skip to content

Commit a39ea8d

Browse files
fix: удаление таймера failover
- Таймер failover приводил к бесконечному переподключению, если ядро не успевало стартовать. Теперь он удалён, и приложение остается на выбранном быстром профиле.
1 parent aac8179 commit a39ea8d

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

V2rayNG/app/src/main/java/com/kiktor/v2whitelist/handler/SmartConnectManager.kt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import java.net.HttpURLConnection
3232
import java.net.URL
3333

3434
object SmartConnectManager {
35-
private var failoverJob: Job? = null
3635
private val testSemaphore = Semaphore(48)
3736

3837
// Ссылка-матрёшка: сначала загружаем этот файл, в нём — реальный URL подписки
@@ -256,24 +255,12 @@ object SmartConnectManager {
256255
} else {
257256
V2RayServiceManager.startVService(context)
258257
}
259-
startFailoverTimer(context)
260258
} else {
261259
Log.e(AppConfig.TAG, "Critical: No servers available to connect")
262260
sendStatus(context, context.getString(R.string.status_no_servers))
263261
}
264262
}
265263

266-
private fun startFailoverTimer(context: Context) {
267-
failoverJob?.cancel()
268-
failoverJob = CoroutineScope(Dispatchers.Main).launch {
269-
delay(15000)
270-
if (!V2RayServiceManager.isRunning()) {
271-
Log.w(AppConfig.TAG, "Connection failed within 15s, triggering failover")
272-
switchServer(context)
273-
}
274-
}
275-
}
276-
277264
/**
278265
* Switches to the next best server.
279266
*/
@@ -307,7 +294,6 @@ object SmartConnectManager {
307294
} else {
308295
V2RayServiceManager.startVService(context)
309296
}
310-
startFailoverTimer(context)
311297
}
312298
}
313299
}

0 commit comments

Comments
 (0)