Spaces:
Paused
Paused
"fix: asnc problem"
Browse files- bot_telegram.py +2 -2
bot_telegram.py
CHANGED
|
@@ -250,7 +250,7 @@ class TelegramBot:
|
|
| 250 |
result = await asyncio.get_event_loop().run_in_executor(
|
| 251 |
self.excel_executor,
|
| 252 |
self._process_excel_sync,
|
| 253 |
-
file_bytes,
|
| 254 |
document.file_name
|
| 255 |
)
|
| 256 |
|
|
@@ -283,7 +283,7 @@ class TelegramBot:
|
|
| 283 |
self.active_excel_files[message_id]['status'] = 'completed'
|
| 284 |
self.active_excel_files[message_id]['end_time'] = time.time()
|
| 285 |
|
| 286 |
-
|
| 287 |
"""Synchronous function to process Excel file without timeout"""
|
| 288 |
try:
|
| 289 |
headers = {
|
|
|
|
| 250 |
result = await asyncio.get_event_loop().run_in_executor(
|
| 251 |
self.excel_executor,
|
| 252 |
self._process_excel_sync,
|
| 253 |
+
file_bytes, # Now file_bytes is defined
|
| 254 |
document.file_name
|
| 255 |
)
|
| 256 |
|
|
|
|
| 283 |
self.active_excel_files[message_id]['status'] = 'completed'
|
| 284 |
self.active_excel_files[message_id]['end_time'] = time.time()
|
| 285 |
|
| 286 |
+
def _process_excel_sync(self, file_bytes, filename):
|
| 287 |
"""Synchronous function to process Excel file without timeout"""
|
| 288 |
try:
|
| 289 |
headers = {
|