diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-06-20 16:14:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-06-20 16:14:51 +0100 |
commit | b2df28925f5ffc785969a973e0bfb5c5670d9d2b (patch) | |
tree | e1aa07901f7d382146541e882795cec2e2e368fb | |
parent | 1609c243964270bf033f6b79bd7946be3fec33f9 (diff) | |
download | rspamd-b2df28925f5ffc785969a973e0bfb5c5670d9d2b.tar.gz rspamd-b2df28925f5ffc785969a973e0bfb5c5670d9d2b.zip |
[Minor] Further logic tunes
-rw-r--r-- | src/libserver/symcache/symcache_runtime.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libserver/symcache/symcache_runtime.cxx b/src/libserver/symcache/symcache_runtime.cxx index c02069fb2..dc7066b32 100644 --- a/src/libserver/symcache/symcache_runtime.cxx +++ b/src/libserver/symcache/symcache_runtime.cxx @@ -797,22 +797,25 @@ auto symcache_runtime::finalize_item(struct rspamd_task *task, cache_dynamic_ite * on its own. Hence, we need to make some corrections for all * rules pending */ - + bool need_slow = false; for (const auto &[i, other_item]: rspamd::enumerate(order->d)) { auto *other_dyn_item = &dynamic_items[i]; if (other_dyn_item->status == cache_item_status::pending && other_dyn_item->start_msec <= dyn_item->start_msec) { other_dyn_item->start_msec += diff; - msg_debug_cache_task("adjust start time for %s(%d) by %.2fms to %dms", + msg_debug_cache_task("slow sync rule %s(%d); adjust start time for pending rule %s(%d) by %.2fms to %dms", + item->symbol.c_str(), item->id, other_item->symbol.c_str(), other_item->id, diff, (int) other_dyn_item->start_msec); + /* We have something pending, so we need to enable slow timer */ + need_slow = true; } } - if (slow_status == slow_status::none) { + if (need_slow && slow_status != slow_status::enabled) { slow_status = slow_status::enabled; msg_info_task("slow synchronous rule: %s(%d): %.2f ms; enable 100ms idle timer to allow other rules to be finished", |