从 RSS 条目中提取 DOI
(entry)
| 1258 | # which dominated a single journal's runtime (Science measured 48s, |
| 1259 | # Science Advances 60s for 10 papers). _http_get builds and closes its own |
| 1260 | # session per call, so there is no shared state to guard. executor.map |
| 1261 | # keeps feed order, and _skip filtering stays positional. |
| 1262 | detail_workers = _journal_detail_concurrency(len(candidates)) |
| 1263 | if len(candidates) > 1 and detail_workers > 1: |
| 1264 | def fetch_detail(candidate: Dict[str, Any]) -> Dict[str, Any]: |
| 1265 | try: |
| 1266 | return _fetch_article_detail(candidate["url"]) |
| 1267 | except Exception as exc: |
| 1268 | print(f" Detail fetch error for {candidate.get('url')}: {exc}") |
| 1269 | return {} |
| 1270 | |
| 1271 | with ThreadPoolExecutor(max_workers=detail_workers) as executor: |
| 1272 | details = list(executor.map(fetch_detail, candidates)) |
| 1273 | else: |
| 1274 | details = [_fetch_article_detail(candidate["url"]) for candidate in candidates] |
| 1275 | |
| 1276 | for candidate, detail in zip(candidates, details): |
no test coverage detected