KComponent icon indicating copy to clipboard operation
KComponent copied to clipboard

same request can't launch twice in a second

Open binglingziyu opened this issue 1 year ago • 3 comments

OpenOnceInterceptor.kt#L37

val currentTime = System.currentTimeMillis()

// 如果把系统时间修改到当前时间之前,这里会一直 throw NavigationException
if (map.containsKey(hostAndPath) && currentTime - map[hostAndPath]!! < requiredConfig().routeRepeatCheckDuration) {
    throw NavigationException("same request can't launch twice in a second, target uri is:$uri")
} else {
......
}

binglingziyu avatar Apr 30 '24 10:04 binglingziyu

那你这。。。 你这是属于 App 没杀掉改的时间吧. 如果在 App 运行期间不改, 是不会有这个问题的 如果你实在介意, 你可以禁用这个功能, 有配置的

xiaojinzi123 avatar Apr 30 '24 13:04 xiaojinzi123

是 App 没杀掉改的时间。

已经使用下面的配置禁用了:

Config.Builder()
    .useRouteRepeatCheckInterceptor(false)
    .build()

但 OpenOnceInterceptor 还是很有用的,是不是把 currentTime - map[hostAndPath]!! 取个绝对值来代表 1 秒内。

binglingziyu avatar Apr 30 '24 14:04 binglingziyu

你小子, 说的很有道理哦. 我有空招你说的改, 然后发个版

xiaojinzi123 avatar Apr 30 '24 23:04 xiaojinzi123