瀏覽代碼

do not load files cache for commands not using it, fixes #5673

Thomas Waldmann 4 年之前
父節點
當前提交
02a9db50d2
共有 2 個文件被更改,包括 2 次插入5 次删除
  1. 2 2
      src/borg/constants.py
  2. 0 3
      src/borg/helpers/parseformat.py

+ 2 - 2
src/borg/constants.py

@@ -83,8 +83,8 @@ ITEMS_CHUNKER_PARAMS = (CH_BUZHASH, 15, 19, 17, HASH_WINDOW_SIZE)
 CH_DATA, CH_ALLOC, CH_HOLE = 0, 1, 2
 
 # operating mode of the files cache (for fast skipping of unchanged files)
-DEFAULT_FILES_CACHE_MODE_UI = 'ctime,size,inode'
-DEFAULT_FILES_CACHE_MODE = 'cis'  # == CacheMode(DEFAULT_FILES_CACHE_MODE_UI)
+DEFAULT_FILES_CACHE_MODE_UI = 'ctime,size,inode'  # default for "borg create" command (CLI UI)
+DEFAULT_FILES_CACHE_MODE = 'd'  # most borg commands do not use the files cache at all (disable)
 
 # return codes returned by borg command
 # when borg is killed by signal N, rc = 128 + N

+ 0 - 3
src/borg/helpers/parseformat.py

@@ -141,9 +141,6 @@ def FilesCacheMode(s):
     return mode
 
 
-assert FilesCacheMode(DEFAULT_FILES_CACHE_MODE_UI) == DEFAULT_FILES_CACHE_MODE  # keep these 2 values in sync!
-
-
 def partial_format(format, mapping):
     """
     Apply format.format_map(mapping) while preserving unknown keys