fix(import): harden automatic incremental imports

This commit is contained in:
digua committed 2026-07-13 01:01:42 +08:00
1 parent 6dc35722c0
commit 61d42b2500
42 files changed
+1075 -118

No files matched your search

+1 -1
View File
@@ -371,7 +371,7 @@ ChatLab 不为调用方维护游标。推荐结构:
### 并发约束
当前版本:**同一 session 同一时刻仅允许一个导入任务**。对同一 sessionId 的并发请求会收到 `IMPORT_IN_PROGRESS` (409) 错误;不同 session 的并发导入互不影响。
当前版本:**同一用户数据目录同一时刻仅允许一个写入型导入任务**。如果 Desktop、CLI、Web 或 Push API 已在向该数据目录导入,后续请求即使目标 sessionId 不同,也会收到 `IMPORT_IN_PROGRESS` (409) 错误。格式检测、导入分析等只读操作不受此限制。
---
+1 -1
View File
@@ -371,7 +371,7 @@ After each successful batch, update the cursor with `session.lastTimestamp` from
### Concurrency
Current version: **only one import task is allowed at a time per session**. Concurrent requests to the same sessionId return `IMPORT_IN_PROGRESS` (409); imports to different sessions run independently.
Current version: **only one write import task is allowed at a time per user data directory**. If Desktop, CLI, Web, or the Push API is already importing into that data directory, later requests return `IMPORT_IN_PROGRESS` (409) even when they target a different sessionId. Read-only format detection and import analysis are not blocked.
---