From 848ddf7fb7111ce6859dda9eb559642da385c312 Mon Sep 17 00:00:00 2001 From: Kpa-clawbot <259247574+Kpa-clawbot@users.noreply.github.com> Date: Fri, 27 Mar 2026 22:45:48 -0700 Subject: [PATCH] fix: node pruning runs hourly not daily Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cmd/ingestor/main.go | 2 +- server.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/ingestor/main.go b/cmd/ingestor/main.go index 95ef01a1..dc2a32ee 100644 --- a/cmd/ingestor/main.go +++ b/cmd/ingestor/main.go @@ -47,7 +47,7 @@ func main() { store.MoveStaleNodes(nodeDays) // Daily ticker for node retention - retentionTicker := time.NewTicker(24 * time.Hour) + retentionTicker := time.NewTicker(1 * time.Hour) go func() { for range retentionTicker.C { store.MoveStaleNodes(nodeDays) diff --git a/server.js b/server.js index 422d9c43..865adf8c 100644 --- a/server.js +++ b/server.js @@ -18,6 +18,7 @@ const { loadConfigFile, loadThemeFile, buildHealthConfig, getHealthMs: _getHealt const config = loadConfigFile(); const decoder = require('./decoder'); const PAYLOAD_TYPES = decoder.PAYLOAD_TYPES; +const hasNonPrintableChars = decoder.hasNonPrintableChars; const { nodeNearRegion, IATA_COORDS } = require('./iata-coords'); const { execSync } = require('child_process'); @@ -481,7 +482,7 @@ const RETENTION_NODE_DAYS = (config.retention && config.retention.nodeDays) || 7 db.moveStaleNodes(RETENTION_NODE_DAYS); setInterval(() => { db.moveStaleNodes(RETENTION_NODE_DAYS); -}, 24 * 3600000).unref(); +}, 3600000).unref(); // hourly // --- Health / Telemetry Endpoint --- app.get('/api/health', (req, res) => { @@ -2198,6 +2199,9 @@ app.get('/api/channels', (req, res) => { if (decoded.type !== 'CHAN') continue; const channelName = decoded.channel || 'unknown'; + // Filter out garbage-decrypted channel names (pre-#197 data still in DB) + if (hasNonPrintableChars(channelName)) continue; + if (hasNonPrintableChars(decoded.text)) continue; const key = channelName; if (!channelMap[key]) {