updated kopia state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2024-10-27 12:52:57 +01:00
parent 307a301baa
commit 00ef9a19b6

View File

@ -50,10 +50,10 @@ def set_policy(compression="zstd"):
return run_policy.returncode == 0
def set_cache():
def set_cache(size=500, limit=1000):
rcs = []
cmds_cache = [f"{KOPIA_EXEC} cache set --content-cache-size-mb 1000 --config-file={KOPIA_CONFIG_PATH}",
f"{KOPIA_EXEC} cache set --content-cache-size-limit-mb 2000 --config-file={KOPIA_CONFIG_PATH}"]
cmds_cache = [f"{KOPIA_EXEC} cache set --content-cache-size-mb {size} --config-file={KOPIA_CONFIG_PATH}",
f"{KOPIA_EXEC} cache set --content-cache-size-limit-mb {limit} --config-file={KOPIA_CONFIG_PATH}"]
for cmd_cache in cmds_cache:
run_cache = Popen(cmd_cache, shell=True, stdout=PIPE, stderr=PIPE)
run_cache.wait()
@ -98,7 +98,7 @@ if __name__ == "__main__":
if not set_policy():
print("set policy error")
sys.exit(1)
if not set_cache():
if not set_cache({{ kopia.repos[params.repo].cache_size|default(500) }},{{ kopia.repos[params.repo].cache_limit|default(1000) }}):
print("set cache error")
sys.exit(1)
if not run(before_tasks={{ params.before_tasks|default([]) }}):