mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 12:45:47 +01:00
add db flush on quit
This commit is contained in:
parent
d36fe2871f
commit
7df357c4e2
1 changed files with 5 additions and 1 deletions
|
|
@ -87,9 +87,13 @@ pub async fn daemon(
|
|||
|
||||
let _ = socket_manager_task_handle.await;
|
||||
|
||||
let db_ok = db.flush();
|
||||
|
||||
let stop_ok = config.stop();
|
||||
|
||||
if !signal_received.load(Ordering::SeqCst) {
|
||||
if let Err(err) = db_ok {
|
||||
Err(format!("database was not saved, unrecoverable error: {}", err).into())
|
||||
} else if !signal_received.load(Ordering::SeqCst) {
|
||||
Err("quitting because all streams finished".into())
|
||||
} else if !stop_ok {
|
||||
Err("while executing stop command".into())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue