Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even better qdrant killing #878

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/desktop/src-tauri/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::sync::Arc;
use bleep::{analytics, Application, Configuration, Environment};
use once_cell::sync::OnceCell;
use sentry::ClientInitGuard;
use tauri::{plugin::Plugin, Invoke};
use tracing::{error, warn};

use super::{Manager, Payload, Runtime};
Expand Down
14 changes: 9 additions & 5 deletions apps/desktop/src-tauri/src/qdrant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::{
};

use tauri::{plugin::Plugin, Runtime};
use tracing::warn;

use super::relative_command_path;

Expand Down Expand Up @@ -49,11 +50,14 @@ where
fn on_event(&mut self, _app: &tauri::AppHandle<R>, event: &tauri::RunEvent) {
use tauri::RunEvent::{Exit, ExitRequested};
if matches!(event, Exit | ExitRequested { .. }) {
self.child
.take()
.expect("qdrant not started")
.kill()
.expect("failed to kill qdrant")
let Some(mut child) = self.child.take() else {
warn!("qdrant has been killed");
ggordonhall marked this conversation as resolved.
Show resolved Hide resolved
return;
};

if let Err(err) = child.kill() {
warn!(?err, "failed to kill qdrant");
};
}
}
}
Expand Down