Skip to content

Commit 38c5886

Browse files
committed
fix: TimeoutError 捕获兼容 Python <3.11 的 concurrent.futures.TimeoutError
1 parent c5e65f3 commit 38c5886

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

quantclass_sync_internal/orchestrator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import threading
99
import traceback
1010
import time
11-
from concurrent.futures import ThreadPoolExecutor, as_completed
11+
from concurrent.futures import ThreadPoolExecutor, TimeoutError as FuturesTimeoutError, as_completed
1212
from datetime import date, datetime, timedelta
1313
from pathlib import Path
1414
from typing import Callable, Dict, Iterable, List, Optional, Sequence, Tuple
@@ -965,7 +965,7 @@ def _fetch_one(product: str) -> Tuple[str, Optional[str]]:
965965
pass
966966
if abort_event.is_set():
967967
break
968-
except TimeoutError:
968+
except (TimeoutError, FuturesTimeoutError):
969969
log_info("[预取] 超时,放弃剩余查询", event="PREFETCH", decision="timeout")
970970
finally:
971971
executor.shutdown(wait=False, cancel_futures=True)

0 commit comments

Comments
 (0)