From f97ecd547b9327cf842f7b3165f0ae85063951af Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 2 Mar 2016 15:21:41 +0100 Subject: [PATCH] Track old id when diffing, to track down not found entries --- loader/lib/storage.py | 4 ++-- loader/reparse_message.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/loader/lib/storage.py b/loader/lib/storage.py index e7eeb95..56e5d1c 100644 --- a/loader/lib/storage.py +++ b/loader/lib/storage.py @@ -233,7 +233,7 @@ class ArchivesParserStorage(ArchivesParser): opstatus.stored += 1 - def diff(self, conn, f, fromonlyf): + def diff(self, conn, f, fromonlyf, oldid): curs = conn.cursor() # Fetch the old one so we have something to diff against @@ -244,7 +244,7 @@ class ArchivesParserStorage(ArchivesParser): id, _from, _to, cc, subject, date, has_attachment, bodytxt = curs.fetchone() except TypeError, e: f.write("---- %s ----\n" % self.msgid) - f.write("Could not re-find in archives: %s\n" % e) + f.write("Could not re-find in archives (old id was %s): %s\n" % (oldid, e)) f.write("\n-------------------------------\n\n") return diff --git a/loader/reparse_message.py b/loader/reparse_message.py index 2e82962..a2895f4 100755 --- a/loader/reparse_message.py +++ b/loader/reparse_message.py @@ -102,7 +102,7 @@ if __name__ == "__main__": if opt.update: ap.store(conn, listid=-9, overwrite=True) else: - ap.diff(conn, f, fromonlyf) + ap.diff(conn, f, fromonlyf, id) if datetime.now() - laststatus > timedelta(seconds=5): sys.stdout.write("%s messages parsed (%s / second)\r" % (num, num / ((datetime.now()-firststatus).seconds))) sys.stdout.flush() -- 2.39.5