From 313d8c9478b4a5e4f43d40c711eb0908157e1e97 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 13 Nov 2016 12:51:50 -0800 Subject: [PATCH] Don't prune threads on index refresh that have yet to appear in the index. --- src/Monitoring/ThreadWatcher.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index e829b9795..d4ef998f4 100644 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -145,6 +145,8 @@ ThreadWatcher = boardID = g.BOARD.ID nKilled = 0 for threadID, data of db.data.boards[boardID] when not data?.isDead and "#{boardID}.#{threadID}" not in e.detail.threads + # Don't prune threads that have yet to appear in index. + continue unless e.detail.threads.some (fullID) -> +fullID.split('.')[1] > threadID nKilled++ if Conf['Auto Prune'] or not (data and typeof data is 'object') # corrupt data db.delete {boardID, threadID}