expire_mod module

Functions related to expiring old data from a repo.

Sort of belongs in repo_mod, but doesn’t really have much overlap, and repo_mod is getting kind of big.

expire_mod.chunks_expiration_traversal(current_time, maximum_age, chunks_string, hash_len, check_hashes)[source]

Traverse the chunks tree, deleting old files and optionally verifying hashes as we go.

expire_mod.expire(current_time, check_hashes)[source]

Expire old chunks, files and savesets from this repository.

expire_mod.expire_files(current_time, maximum_age)[source]

Expire all old hashes. Build a list of current hashes.

expire_mod.expire_hashes(current_time, maximum_age, check_hashes)[source]

Expire all old hashes. Build a list of current hashes.

expire_mod.expire_one_hash(current_time, maximum_age, full_path, full_hash, check_hashes)[source]

Expire one hash file.

expire_mod.expire_savesets(current_time, maximum_age)[source]

Expire old savesets.

expire_mod.files_expiration(current_time, maximum_age, files_string)[source]

Recursively remove files directories that are now too old.

expire_mod.get_maximum_age(our_directory)[source]

Get the maximum age for the repo, one way or another.

expire_mod.is_empty_dir(prefix, list_of_subdirs, list_of_filenames, hash_len)[source]

Return True iff directory is empty.

prefix is the hexadecial derived from this directory. list_of_subdirs is a (possibly empty) list of subdirectories of this directory. list_of_filenames is a (possibly empty) list of filenames in this directory. hash_len is the length we expect a good hash to have.

expire_mod.is_old_dir(directory, high_age)[source]

Return True iff directory is old.

expire_mod.make_used(*var)[source]

Persuade linters that var is used.

expire_mod.rmtree_onerror(function, path, exception)[source]

Deal with errors from rmtree.