Return the name of the files cache file for the given archive name. :param archive_name: name of the archive (ideally a series name) :param files_cache_name: base name of the files cache file :return: name of the files cache file
(archive_name, files_cache_name="files")
| 41 | |
| 42 | |
| 43 | def files_cache_name(archive_name, files_cache_name="files"): |
| 44 | """ |
| 45 | Return the name of the files cache file for the given archive name. |
| 46 | |
| 47 | :param archive_name: name of the archive (ideally a series name) |
| 48 | :param files_cache_name: base name of the files cache file |
| 49 | :return: name of the files cache file |
| 50 | """ |
| 51 | suffix = os.environ.get("BORG_FILES_CACHE_SUFFIX", "") |
| 52 | # when using archive series, we automatically make up a separate cache file per series. |
| 53 | # when not, the user may manually do that by using the env var. |
| 54 | if not suffix: |
| 55 | # avoid issues with too complex or long archive_name by hashing it: |
| 56 | suffix = xxh64(archive_name.encode()).hexdigest() |
| 57 | return files_cache_name + "." + suffix |
| 58 | |
| 59 | |
| 60 | def discover_files_cache_names(path, files_cache_name="files"): |