Skip to content

fix: lock shared-directory archive extraction when redis cache is enabled - #812

Open
CK-WXQ wants to merge 1 commit into
kekingcn:masterfrom
CK-WXQ:fix/shared-archive-extract-lock
Open

CK-WXQ wants to merge 1 commit into
kekingcn:masterfrom
CK-WXQ:fix/shared-archive-extract-lock

Conversation

@CK-WXQ

@CK-WXQ CK-WXQ commented Oct 30, 2026

Copy link
Copy Markdown

解决 #811。

分支:fix/shared-archive-extract-lock
https://github.com/CK-WXQ/kkFileView/tree/fix/shared-archive-extract-lock

cache.type=redis 时,两个实例共用 file.dir,会同时解压同一份压缩包。先完成的实例在 unRar 之后删掉源文件,后到的实例还停在 item.extractSlow 里,sevenzip 会把进程 abort 掉。

这次在 Redis 缓存下按文件名加锁,键是 kk-compress: 加文件名。锁的范围盖住下载、解压、删除源文件和写入目录缓存。默认的本地缓存不加锁。等锁上限 50 秒。

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant