mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Update
This commit is contained in:
@@ -454,7 +454,7 @@ async fn download_archive(
|
||||
tokio::spawn(async move {
|
||||
let mut i = 15 * 60 / 5;
|
||||
|
||||
while task.status != TaskStatus::Complete && i >= 0 {
|
||||
while task.status == TaskStatus::InProgress && i >= 0 {
|
||||
task = match get_task(task.id).await {
|
||||
Ok(v) => v,
|
||||
Err(err) => {
|
||||
@@ -470,6 +470,18 @@ async fn download_archive(
|
||||
},
|
||||
};
|
||||
|
||||
bot
|
||||
.edit_message_text(
|
||||
message.chat.id,
|
||||
message.id,
|
||||
format!("Подготовка архива: {}", task.status_description)
|
||||
)
|
||||
.reply_markup(InlineKeyboardMarkup {
|
||||
inline_keyboard: vec![],
|
||||
})
|
||||
.send()
|
||||
.await?;
|
||||
|
||||
sleep(Duration::from_secs(5)).await;
|
||||
|
||||
i -= 1;
|
||||
@@ -485,6 +497,10 @@ async fn download_archive(
|
||||
.await?;
|
||||
|
||||
return Ok(());
|
||||
} else {
|
||||
bot
|
||||
.delete_message(message.chat.id, message.id)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let downloaded_data = match download_file_by_link(
|
||||
|
||||
Reference in New Issue
Block a user