diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2023-12-11 18:06:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-11 18:06:14 +0000 |
| commit | 9ca8f10bf3a08c710d1d79d3fbc1f024d450022a (patch) | |
| tree | 22dc007eb23eb1573e1bfa898a8035d47349104f | |
| parent | chore(repo): remove issue config (#1433) (diff) | |
| download | atuin-9ca8f10bf3a08c710d1d79d3fbc1f024d450022a.zip | |
fix blocking for #1381 (#1438)
Diffstat (limited to '')
| -rw-r--r-- | atuin/src/command/client.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/atuin/src/command/client.rs b/atuin/src/command/client.rs index 312bcafa..d0f58c4a 100644 --- a/atuin/src/command/client.rs +++ b/atuin/src/command/client.rs @@ -52,8 +52,20 @@ pub enum Cmd { } impl Cmd { - #[tokio::main(flavor = "current_thread")] - pub async fn run(self) -> Result<()> { + pub fn run(self) -> Result<()> { + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap(); + + let res = runtime.block_on(self.run_inner()); + + runtime.shutdown_timeout(std::time::Duration::from_millis(50)); + + res + } + + async fn run_inner(self) -> Result<()> { Builder::new() .filter_level(log::LevelFilter::Off) .parse_env("ATUIN_LOG") |
