Merge pull request #5516 from shawnlu96/fix/alipan-snapshot-monitoring

This commit is contained in:
jxxghp
2026-02-27 07:07:31 +08:00
committed by GitHub
3 changed files with 11 additions and 7 deletions

View File

@@ -414,6 +414,8 @@ class ConfigModel(BaseModel):
RCLONE_SNAPSHOT_CHECK_FOLDER_MODTIME: bool = True
# 对OpenList进行快照对比时是否检查文件夹的修改时间
OPENLIST_SNAPSHOT_CHECK_FOLDER_MODTIME: bool = True
# 对阿里云盘进行快照对比时,是否检查文件夹的修改时间(默认关闭,因为阿里云盘目录时间不随子文件变更而更新)
ALIPAN_SNAPSHOT_CHECK_FOLDER_MODTIME: bool = False
# ==================== Docker配置 ====================
# Docker Client API地址

View File

@@ -261,8 +261,7 @@ class StorageBase(metaclass=ABCMeta):
for sub_file in sub_files:
__snapshot_file(sub_file, current_depth + 1)
else:
# 记录文件的完整信息用于比对
if getattr(_fileitm, 'modify_time', 0) > last_snapshot_time:
# 记录文件的完整信息用于比对(始终包含所有文件,由 compare_snapshots 负责检测变化)
files_info[_fileitm.path] = {
'size': _fileitm.size or 0,
'modify_time': getattr(_fileitm, 'modify_time', 0),

View File

@@ -43,6 +43,9 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
# 基础url
base_url = "https://openapi.alipan.com"
# 阿里云盘目录时间不随子文件变更而更新,默认关闭目录修改时间检查
snapshot_check_folder_modtime = settings.ALIPAN_SNAPSHOT_CHECK_FOLDER_MODTIME
# 文件块大小默认10MB
chunk_size = 10 * 1024 * 1024