add option to set borg_files_cache_ttl in config #654

Merged
witten merged 2 commits from Soumik_Dutta/borgmatic:feat618-allow-setting-borg-files-cache-ttl into master 2023-03-18 02:24:42 +00:00
Contributor

Implements #618

Notes about about the str cast

Setting integer variables are not allowed and setting them as such will raise Exceptions in python os package,

TypeError: expected str, bytes or os.PathLike object, not int

So I had to add a str cast to the value.

Signed-off-by: Soumik Dutta shalearkane@gmail.com

Implements [#618](https://projects.torsion.org/borgmatic-collective/borgmatic/issues/618) ###### Notes about about the `str` cast Setting integer variables are not allowed and setting them as such will raise Exceptions in python `os` package, ```python TypeError: expected str, bytes or os.PathLike object, not int ``` So I had to add a `str` cast to the `value`. Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
Soumik_Dutta added 1 commit 2023-03-17 20:20:24 +00:00
0db137efdf add option to set borg_files_cache_ttl in config
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
witten reviewed 2023-03-17 20:26:37 +00:00
witten left a comment
Owner

This looks great! I'm happy to merge whenever you are ready.

This looks great! I'm happy to merge whenever you are ready.
@ -28,3 +29,3 @@
if value:
environment[environment_variable_name] = value
environment[environment_variable_name] = str(value)
Owner

You might consider adding a test for the fact that this converts integer values to strings in tests/unit/borg/test_environment.py. I certainly don't feel strongly about it though.

You might consider adding a test for the fact that this converts integer values to strings in `tests/unit/borg/test_environment.py`. I certainly don't feel strongly about it though.
@ -318,0 +318,4 @@
borg_files_cache_ttl:
type: integer
description: |
Maximum time to live (ttl) for entries in the borg files
Owner

Minor nit: Capitalize "Borg" here.

Minor nit: Capitalize "Borg" here.
Soumik_Dutta added 1 commit 2023-03-17 21:28:05 +00:00
fb9677230b add test to ensure integers are converted to string
before setting them up to be environment variable values

Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
Soumik_Dutta changed title from WIP: add option to set borg_files_cache_ttl in config to add option to set borg_files_cache_ttl in config 2023-03-18 00:03:57 +00:00
Owner

Thank you!

Thank you!
witten merged commit 214ae81cbb into master 2023-03-18 02:24:42 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#654
No description provided.