:3
This commit is contained in:
parent
8f9fbfc555
commit
73b64954e6
|
@ -3,6 +3,7 @@ use eyre::Result;
|
||||||
use mail_parser::MessageParser;
|
use mail_parser::MessageParser;
|
||||||
use std::{
|
use std::{
|
||||||
ffi::{c_char, CStr},
|
ffi::{c_char, CStr},
|
||||||
|
panic::catch_unwind,
|
||||||
sync::Mutex,
|
sync::Mutex,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@ extern "C" fn message_handler_wrapper(message: *const c_char) {
|
||||||
println!("Creating körtid");
|
println!("Creating körtid");
|
||||||
let handle = tokio::runtime::Runtime::new().expect("Couldn't skapa the körtid");
|
let handle = tokio::runtime::Runtime::new().expect("Couldn't skapa the körtid");
|
||||||
println!("Går in i körtid");
|
println!("Går in i körtid");
|
||||||
handle.block_on(message_handler(message)).unwrap();
|
let _ = catch_unwind(|| handle.block_on(message_handler(message)));
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn message_handler(message: String) -> Result<()> {
|
async fn message_handler(message: String) -> Result<()> {
|
||||||
|
|
Loading…
Reference in a new issue