feat: totally updated cache structure using lru crate instead of moka (i.e., using simpler crate)

This commit is contained in:
Jun Kurihara 2023-08-16 23:04:04 +09:00
commit 07d3accb91
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
10 changed files with 157 additions and 132 deletions

View file

@ -1,4 +1,12 @@
pub const LISTEN_ADDRESSES_V4: &[&str] = &["0.0.0.0"];
pub const LISTEN_ADDRESSES_V6: &[&str] = &["[::]"];
pub const CONFIG_WATCH_DELAY_SECS: u32 = 20;
// Cache directory
pub const CACHE_DIR: &str = "./cache";
// # of entries in cache
pub const MAX_CACHE_ENTRY: usize = 1_000;
// max size for each file in bytes
pub const MAX_CACHE_EACH_SIZE: usize = 65_535;
// TODO: max cache size in total