This commit is contained in:
@@ -116,6 +116,14 @@ impl AppState {
|
||||
Ok(new_path)
|
||||
}
|
||||
|
||||
pub async fn set_path(&self, filename: &str, filepath: &str) {
|
||||
let mut redis = self.redis.clone();
|
||||
let _: () = redis
|
||||
.hset(PATH_MAPPING_KEY, filename, filepath)
|
||||
.await
|
||||
.expect(&format!("Failed to cache file {} in Redis", filename));
|
||||
}
|
||||
|
||||
/// создает или получает текущее значение квоты пользователя
|
||||
pub async fn get_or_create_quota(&self, user_id: &str) -> Result<u64, actix_web::Error> {
|
||||
let mut redis = self.redis.clone();
|
||||
|
Reference in New Issue
Block a user