fix: use std::sync::RwLock for cache to support sync methods
Some checks failed
BotServer CI/CD / build (push) Failing after 6m3s
Some checks failed
BotServer CI/CD / build (push) Failing after 6m3s
This commit is contained in:
parent
fd7f48c423
commit
0ac8178baa
1 changed files with 3 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ use std::path::PathBuf;
|
|||
use std::sync::Arc;
|
||||
use std::sync::Arc as StdArc;
|
||||
use tokio::sync::RwLock;
|
||||
use std::sync::RwLock as StdRwLock;
|
||||
use uuid::Uuid;
|
||||
use vaultrs::client::{VaultClient, VaultClientSettingsBuilder};
|
||||
use vaultrs::kv2;
|
||||
|
|
@ -62,7 +63,7 @@ struct CachedSecret {
|
|||
#[derive(Clone)]
|
||||
pub struct SecretsManager {
|
||||
client: Option<StdArc<VaultClient>>,
|
||||
cache: Arc<RwLock<HashMap<String, CachedSecret>>>,
|
||||
cache: Arc<std::sync::RwLock<HashMap<String, CachedSecret>>>,
|
||||
cache_ttl: u64,
|
||||
enabled: bool,
|
||||
}
|
||||
|
|
@ -106,7 +107,7 @@ impl SecretsManager {
|
|||
warn!("Vault not configured. Using environment variables directly.");
|
||||
return Ok(Self {
|
||||
client: None,
|
||||
cache: Arc::new(RwLock::new(HashMap::new())),
|
||||
cache: Arc::new(StdRwLock::new(HashMap::new())),
|
||||
cache_ttl,
|
||||
enabled: false,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue