perf: scope effect dedupe keys
Some checks are pending
CI / test (push) Waiting to run
CI / clippy (push) Waiting to run
CI / bench-check (push) Waiting to run
CI / wasm-check (push) Waiting to run
CI / fmt (push) Waiting to run

This commit is contained in:
KhooLy 2026-07-31 22:07:41 +03:00
parent 23b3a697df
commit 37b75b1358

View file

@ -210,7 +210,11 @@ impl EffectEnvelope {
pub fn new(id: String, kind: EffectKind, generation: u64, payload: serde_json::Value) -> Self {
let (group_id, priority, cache_policy, timeout_ms) = effect_schedule(kind);
Self {
dedupe_key: group_id.as_ref().map(|_| format!("{}:{generation}", kind.as_str())),
dedupe_key: group_id.as_ref().and_then(|_| {
serde_json::to_string(&payload)
.ok()
.map(|payload_key| format!("{}:{generation}:{payload_key}", kind.as_str()))
}),
id,
kind: kind.as_str().to_owned(),
generation,