mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
Remove usage of block_on inside of async function
This commit is contained in:
parent
cc07b914c1
commit
751adc04c3
1 changed files with 47 additions and 45 deletions
|
@ -123,7 +123,8 @@ impl Lune {
|
|||
.detach();
|
||||
// Run the executor until there are no tasks left,
|
||||
// taking care to not exit right away for errors
|
||||
let (got_code, got_error, exit_code) = smol::block_on(exec.run(async {
|
||||
let (got_code, got_error, exit_code) = exec
|
||||
.run(async {
|
||||
let mut task_count = 0;
|
||||
let mut got_error = false;
|
||||
let mut got_code = false;
|
||||
|
@ -170,7 +171,8 @@ impl Lune {
|
|||
}
|
||||
}
|
||||
Ok((got_code, got_error, exit_code))
|
||||
}))?;
|
||||
})
|
||||
.await?;
|
||||
// If we got an error, we will default to exiting
|
||||
// with code 1, unless a code was manually given
|
||||
if got_code {
|
||||
|
|
Loading…
Reference in a new issue