correct error on settings delete unexisting index

This commit is contained in:
mpostma 2021-03-11 22:33:31 +01:00
parent 30dd790884
commit 66b64c1f80
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
3 changed files with 13 additions and 8 deletions

View file

@ -129,8 +129,12 @@ impl IndexController {
Ok(status)
}
pub async fn update_settings(&self, index_uid: String, settings: Settings) -> anyhow::Result<UpdateStatus> {
let uuid = self.uuid_resolver.get_or_create(index_uid).await?;
pub async fn update_settings(&self, index_uid: String, settings: Settings, create: bool) -> anyhow::Result<UpdateStatus> {
let uuid = if create {
self.uuid_resolver.get_or_create(index_uid).await?
} else {
self.uuid_resolver.resolve(index_uid).await?
};
let meta = UpdateMeta::Settings(settings);
// Nothing so send, drop the sender right away, as not to block the update actor.
let (_, receiver) = mpsc::channel(1);