From 7ece22c08123c8fb964434c35f65bc15f1ff0edb Mon Sep 17 00:00:00 2001 From: StNicolay Date: Sun, 11 Jun 2023 16:05:00 +0300 Subject: [PATCH] Now the json in /export is created on a sepparate thread --- src/commands/export.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/export.rs b/src/commands/export.rs index bb23345..67c0b72 100644 --- a/src/commands/export.rs +++ b/src/commands/export.rs @@ -51,7 +51,7 @@ async fn get_master_pass( accounts.sort_unstable_by(|this, other| this.name.cmp(&other.name)); - let json = serde_json::to_vec_pretty(&User { accounts })?; + let json = spawn_blocking(move || serde_json::to_vec_pretty(&User { accounts })).await??; let file = InputFile::memory(json).file_name("accounts.json"); bot.send_document(msg.chat.id, file)