perf: 优化规则执行逻辑

This commit is contained in:
lisonge 2024-01-03 19:37:30 +08:00
parent f83e32b8ab
commit dc66369123

View File

@ -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()
}
}
}
}
}