Track old id when diffing, to track down not found entries
authorMagnus Hagander <magnus@hagander.net>
Wed, 2 Mar 2016 14:21:41 +0000 (15:21 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 2 Mar 2016 14:21:41 +0000 (15:21 +0100)
loader/lib/storage.py
loader/reparse_message.py

index e7eeb9513b91c9e0bc78192161decd653cbaa5ad..56e5d1c0a05dc883fa5539e8b26111938d97fdb4 100644 (file)
@@ -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
 
index 2e82962005e4c8be4c32c286527400d05ffa8a1f..a2895f447710f263bbe8906569af9f3d3fa22080 100755 (executable)
@@ -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()