fix(training): show progress while building info summary
This commit is contained in:
1 parent
61c66def3f
commit
60f41dd675
3 files changed
+18
-3
No files matched your search
@@ -636,8 +636,14 @@ async def training_info_command(message: Message, state: FSMContext) -> None:
|
||||
profile = await asyncio.to_thread(get_tone_of_voice, message.from_user.id)
|
||||
if profile.strip():
|
||||
notes = await asyncio.to_thread(get_training_notes, message.from_user.id)
|
||||
await _refresh_training_summary(message.from_user.id, profile, notes)
|
||||
summary = await asyncio.to_thread(get_training_summary, message.from_user.id)
|
||||
status = await OperationStatus.start(
|
||||
message, "⏳ Собираю краткую выжимку…", kind="training"
|
||||
)
|
||||
try:
|
||||
await _refresh_training_summary(message.from_user.id, profile, notes)
|
||||
summary = await asyncio.to_thread(get_training_summary, message.from_user.id)
|
||||
finally:
|
||||
await status.finish(None)
|
||||
rich_html = training_info_rich_html(summary)
|
||||
if not rich_html:
|
||||
await message.answer(
|
||||
|
||||
Reference in new issue
Block a user