mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 11:42:22 +08:00
perf: 优化规则执行逻辑
This commit is contained in:
parent
f83e32b8ab
commit
dc66369123
|
@ -166,14 +166,6 @@ class GkdAbService : CompositionAbService({
|
|||
val actionResult = rule.performAction(context, target)
|
||||
if (actionResult.result) {
|
||||
rule.trigger()
|
||||
if (rule.hasNext) {
|
||||
scope.launch(queryThread) {
|
||||
delay(500L)
|
||||
if (queryTaskJob?.isActive != true) {
|
||||
newQueryTask()
|
||||
}
|
||||
}
|
||||
}
|
||||
toastClickTip()
|
||||
insertClickLog(rule)
|
||||
LogUtils.d(
|
||||
|
@ -184,6 +176,15 @@ class GkdAbService : CompositionAbService({
|
|||
}
|
||||
}
|
||||
}
|
||||
val t = System.currentTimeMillis()
|
||||
if (t - lastTriggerTime < 10_000 || t - appChangeTime < 5_000) {
|
||||
scope.launch(queryThread) {
|
||||
delay(300)
|
||||
if (queryTaskJob?.isActive != true) {
|
||||
newQueryTask()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user