From 978f8f8f822d6c5c530071612235e11c61837a82 Mon Sep 17 00:00:00 2001 From: reverse Date: Mon, 17 Aug 2026 01:19:57 +0000 Subject: [PATCH] reputation: persist the score table on each bump/expire so restarts don't revert to a stale snapshot --- src/modules/reputation.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/reputation.rs b/src/modules/reputation.rs index 18ec2f5..410ce9f 100644 --- a/src/modules/reputation.rs +++ b/src/modules/reputation.rs @@ -135,14 +135,21 @@ impl Module for ReputationMod { self.since_bump += t; self.since_expire += t; self.since_save += t; + // Scores only ever change in bump_scores / expire_old, so persist right + // after each: the on-disk table then always reflects the live one, and a + // restart (however frequent) reloads the current scores instead of + // reverting to whatever the coarse periodic timer last happened to write. if self.since_bump >= dur(s, "reputation_bumpinterval", 300) { self.since_bump = 0; bump_scores(s); + save(s); } if self.since_expire >= dur(s, "reputation_expireinterval", 605) { self.since_expire = 0; expire_old(s); + save(s); } + // Backstop flush: guards any future mutation path that forgets to persist. if self.since_save >= dur(s, "reputation_saveinterval", 902) { self.since_save = 0; save(s);