mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 18:20:30 +08:00
Rename http-server -> radicle-httpd
So that the directory name matches the crate name.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
use std::num::NonZeroUsize;
|
||||
use std::sync::Arc;
|
||||
|
||||
use lru::LruCache;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use radicle::prelude::RepoId;
|
||||
use radicle_surf::Oid;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Cache {
|
||||
pub tree: Arc<Mutex<LruCache<(RepoId, Oid, String), serde_json::Value>>>,
|
||||
}
|
||||
|
||||
impl Cache {
|
||||
/// Creates a new cache of the given size.
|
||||
pub fn new(size: NonZeroUsize) -> Self {
|
||||
Cache {
|
||||
tree: Arc::new(Mutex::new(LruCache::new(size))),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user