From 06c9412b4a4defd9c314e4eb496ba4a283f581d8 Mon Sep 17 00:00:00 2001 From: vylion Date: Mon, 26 Oct 2020 23:19:37 +0100 Subject: [PATCH] Avoid rewriting every file at startup --- archivist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/archivist.py b/archivist.py index f09fb25..9285471 100644 --- a/archivist.py +++ b/archivist.py @@ -123,9 +123,10 @@ class Archivist(object): self.logger.info("Successfully passed through {} ({}) chat.\n".format(cid, reader.title())) if self.bypass: # I forgot what I made this for reader.set_period(random.randint(self.max_period // 2, self.max_period)) + self.store(*reader.archive()) elif reader.period() > self.max_period: reader.set_period(self.max_period) - self.store(*reader.archive()) + self.store(*reader.archive()) yield reader except Exception as e: self.logger.error("Failed passing through {}".format(dirname))