Now the json in /export is created on a sepparate thread

This commit is contained in:
StNicolay 2023-06-11 16:05:00 +03:00
parent fba2bb0b86
commit 7ece22c081
Signed by: StNicolay
GPG Key ID: 9693D04DCD962B0D

View File

@ -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)