Pete news code-review fixes: realm-first ordering, parked-row reap, death-emit gate

- emitZoneClearNews: claim realm-first before the name guard so an unnamed
  straggler's first clear seeds news_realm_firsts (else the next named
  clearer is mis-announced as first-ever). Mirrors backfillZoneFirsts.
- RunMaintenance: reap permanently-parked pete_emit_queue rows (unsent,
  >30d) so a durable Pete outage can't accrete rows forever.
- emitDeathNews: gate on Enabled()/newsEmissionOn() before the char DB
  reads; markAdventureDead fires per-member on party wipes + in the sim.
This commit is contained in:
prosolis
2026-07-11 07:56:41 -07:00
parent ae7ff38996
commit 1634bb1970
3 changed files with 18 additions and 4 deletions

View File

@@ -583,6 +583,11 @@ func markAdventureDead(userID id.UserID, source, location string) {
// unless the seam is enabled. Uses the character name (never the Matrix handle);
// skips silently if the name is unknown.
func emitDeathNews(userID id.UserID, location string) {
// Gate before the char lookups: markAdventureDead fires per-member on a
// party wipe and in the sim harness, so skip the DB reads when disabled.
if !peteclient.Enabled() || !newsEmissionOn() {
return
}
name := charName(userID)
if name == "" {
return