summary refs log tree commit diff stats
path: root/imagestore.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-11-04 13:56:01 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-11-04 13:56:01 -0500
commitb5cc6373fbfe2db20bb14216242c2c56f9bfbafe (patch)
treea5b692aae8c35b3dae8bb06d8eea17d144559bf2 /imagestore.h
parentec9690bbf82829d1ba3bd0fc18831a43fe6405fe (diff)
downloadwizard-b5cc6373fbfe2db20bb14216242c2c56f9bfbafe.tar.gz
wizard-b5cc6373fbfe2db20bb14216242c2c56f9bfbafe.tar.bz2
wizard-b5cc6373fbfe2db20bb14216242c2c56f9bfbafe.zip
Clean up cache every day
Also add a slight delay when downloading images to prevent rate limiting from Scryfall.
Diffstat (limited to 'imagestore.h')
-rw-r--r--imagestore.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/imagestore.h b/imagestore.h index 8c3fecf..2c3495d 100644 --- a/imagestore.h +++ b/imagestore.h
@@ -3,6 +3,7 @@
3 3
4#include <Magick++.h> 4#include <Magick++.h>
5 5
6#include <mutex>
6#include <string> 7#include <string>
7 8
8class imagestore { 9class imagestore {
@@ -11,8 +12,12 @@ class imagestore {
11 12
12 Magick::Image get(std::string key, std::string url) const; 13 Magick::Image get(std::string key, std::string url) const;
13 14
15 void cleanup() const;
16
14 private: 17 private:
15 std::string path_; 18 std::string path_;
19
20 mutable std::mutex mutex_;
16}; 21};
17 22
18#endif /* end of include guard: IMAGESTORE_H_80B1E49F */ 23#endif /* end of include guard: IMAGESTORE_H_80B1E49F */