diff --git a/prosopopee/cache.py b/prosopopee/cache.py index 6f4528c..48c94a6 100644 --- a/prosopopee/cache.py +++ b/prosopopee/cache.py @@ -53,8 +53,7 @@ class Cache(object): def cache_picture(self, source, target, options): self.cache[target] = {"size": os.path.getsize(source), "options": remove_superficial_options(options)} - def __del__(self): - self.json.dump(self.cache, open(self.cache_file_path, "wb")) - + def cache_dump(self): + self.json.dump(self.cache, open(self.cache_file_path, "w")) CACHE = Cache(json=json) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index b482751..9b00ee1 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -601,6 +601,7 @@ def main(): open(Path("build").joinpath("feed.xml"), "wb").write(xml) build_index(settings, front_page_galleries_cover, templates) + CACHE.cache_dump() if __name__ == '__main__':