store-uplaoded-path
All checks were successful
deploy / deploy (push) Successful in 1m5s

This commit is contained in:
2024-10-23 21:41:29 +03:00
parent 4db1ac6ff7
commit a4ea55cf3c
4 changed files with 13 additions and 5 deletions

View File

@@ -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();