deerflow2/backend/app/channels
ly-wang19 420a886e1d
fix(channels): offload blocking filesystem IO in inbound file ingestion (#3529)
_ingest_inbound_files ensured the thread uploads dir (mkdir), enumerated it
(iterdir/is_file) to de-duplicate names, and wrote each downloaded attachment
(write_upload_file_no_symlink) directly on the event loop. Offload the directory
prep and every per-file write via asyncio.to_thread; the genuinely async network
read (file_reader) stays on the loop. Externally observable behavior is unchanged.

Found via `make detect-blocking-io` (HIGH: iterdir on an async path).

Add tests/blocking_io/test_channels_ingest.py anchor, verified red->green under
the strict Blockbuster gate.

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 06:38:54 +08:00
..
__init__.py Refactor DeerFlow to use Gateway's LangGraph-compatible API 2026-04-26 20:38:34 +08:00
base.py feat(channels): add DingTalk channel integration (#2628) 2026-04-30 11:25:33 +08:00
commands.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
connection_identity.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
dingtalk.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
discord.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
feishu.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
manager.py fix(channels): offload blocking filesystem IO in inbound file ingestion (#3529) 2026-06-13 06:38:54 +08:00
message_bus.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
runtime_config_store.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
service.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
slack.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
store.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
telegram.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
wechat.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
wecom.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00