mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 16:51:01 +00:00
Forward the key deletions to zookeeper
This commit is contained in:
@ -175,8 +175,13 @@ impl AuthController {
|
||||
self.store.list_api_keys()
|
||||
}
|
||||
|
||||
pub fn delete_key(&self, uid: Uuid) -> Result<()> {
|
||||
if self.store.delete_api_key(uid)? {
|
||||
pub async fn delete_key(&self, uid: Uuid) -> Result<()> {
|
||||
let store = self.store.clone();
|
||||
let deleted = tokio::task::spawn_blocking(move || store.delete_api_key(uid)).await??;
|
||||
if deleted {
|
||||
if let Some(ref zk) = self.zk {
|
||||
zk.delete(&format!("/auth/{}", uid), None).await?;
|
||||
}
|
||||
Ok(())
|
||||
} else {
|
||||
Err(AuthControllerError::ApiKeyNotFound(uid.to_string()))
|
||||
|
Reference in New Issue
Block a user