库扫描在阅读器从中提供内容时会清除整个页面缓存,在章节中间删除页面
作者: Sawtaytoes创建于 2026年9月6日更新于 2026年9月8日
如何重现问题
- 在阅读器中打开一个长篇章节。100 页以上的网络漫画图片文件章节是最简单的情况,因为缓存目录大小足以使删除和读取重叠。
- 开始阅读,以便阅读器继续从
config/cache/<chapterId>/中请求页面。 - 在您仍在阅读时,在任何库中触发库扫描。监视文件夹中的文件触发即可 -
LibraryWatcher会自行触发扫描。 - 章节部分加载时停止加载页面。
证据
在一个系列中阅读第 57 章和第 58 章,同时在 不同 库中的一个被监视的文件夹正在重新扫描。章节 ID 87289 是第 57 章,87573 是第 58 章。
在一个 11 分钟的阅读会话中,有 6 个缓存删除任务失败:
23:07:26 job 20688 IOException: Directory not empty : '/kavita/config/cache/8679'
23:11:58 job 24131 IOException: Directory not empty : '/kavita/config/cache/87289'
23:11:59 job 24138 IOException: Directory not empty : '/kavita/config/cache/87289'
23:12:39 job 24227 DirectoryNotFoundException: '/kavita/config/cache/87289/079.jpg'
23:14:59 job 24528 IOException: Directory not empty : '/kavita/config/cache/87573'
23:18:03 job 24582 DirectoryNotFoundException: '/kavita/config/cache/87289/'以下是两个日志记录:
[2026-09-05 23:14:59.329] [Error] Hangfire.AutomaticRetryAttribute Failed to process the job '24528': an exception occurred.
System.IO.IOException: Directory not empty : '/kavita/config/cache/87573'
at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath)
at Kavita.Services.DirectoryService.ClearDirectory(String directoryPath) in /home/runner/work/Kavita/Kavita/Kavita.Services/DirectoryService.cs:line 380
at InvokeStub_DirectoryService.ClearDirectory(Object, Span`1)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)[2026-09-05 23:18:03.009] [Error] Hangfire.AutomaticRetryAttribute Failed to process the job '24582': an exception occurred.
…内容来源: Kareadita/Kavita