Convert main from async to sync again

* Make entry point synchronous and switch to global runtime instead.

* Switch all futures::block_on() to global runtime.

* Fix formatting.
This commit is contained in:
Thomas
2022-12-11 19:09:22 +01:00
committed by GitHub
parent 7751afafd2
commit ccce78af66
3 changed files with 25 additions and 20 deletions

View File

@@ -117,8 +117,15 @@ struct UserDataInner {
pub cmd: CommandManager,
}
#[tokio::main]
async fn main() -> Result<(), String> {
lazy_static!(
/// The global Tokio runtime for running asynchronous tasks.
static ref ASYNC_RUNTIME: tokio::runtime::Runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap();
);
fn main() -> Result<(), String> {
register_backtrace_panic_handler();
let backends = {