You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src-tauri/src/database/mod.rs
+8-1
Original file line number
Diff line number
Diff line change
@@ -41,19 +41,26 @@ pub fn start_database(
41
41
42
42
thread::spawn(move || {
43
43
let reader = BufReader::new(output);
44
+
letmut has_started = false;
44
45
45
46
for line in reader.lines(){
46
47
let message = line.unwrap();
47
48
48
49
println!("Surreal: {}", message);
49
50
50
51
window.emit("database:output", message).expect("console output should be delivered");
52
+
53
+
has_started = true;
51
54
}
52
55
53
56
let elapsed = start_at.elapsed().as_millis();
54
57
55
58
if elapsed <= 500{
56
-
window.emit("database:error","Surreal executable not found. Make sure the SurrealDB CLI is available in the command line.").expect("error result should be delivered");
59
+
if !has_started {
60
+
window.emit("database:output","SurrealDB did not start. Are you sure the Surreal executable is available?").expect("console output should be delivered");
61
+
}
62
+
63
+
window.emit("database:error","SurrealDB did not start correctly, check the console for more information").expect("error result should be delivered");
57
64
}else{
58
65
window.emit("database:stop",true).expect("stop result should be delivered");
0 commit comments