From b5cc6373fbfe2db20bb14216242c2c56f9bfbafe Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 4 Nov 2024 13:56:01 -0500 Subject: Clean up cache every day Also add a slight delay when downloading images to prevent rate limiting from Scryfall. --- imagestore.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'imagestore.h') diff --git a/imagestore.h b/imagestore.h index 8c3fecf..2c3495d 100644 --- a/imagestore.h +++ b/imagestore.h @@ -3,6 +3,7 @@ #include +#include #include class imagestore { @@ -11,8 +12,12 @@ class imagestore { Magick::Image get(std::string key, std::string url) const; + void cleanup() const; + private: std::string path_; + + mutable std::mutex mutex_; }; #endif /* end of include guard: IMAGESTORE_H_80B1E49F */ -- cgit 1.4.1