-
-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change housekeeping delete threshold to seconds
- Loading branch information
Showing
12 changed files
with
134 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ universal = 1 | |
|
||
[pycodestyle] | ||
max-line-length = 120 | ||
|
||
[tool:pytest] | ||
norecursedirs=tests/helpers |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import contextlib | ||
import os | ||
|
||
|
||
@contextlib.contextmanager | ||
def mod_env(*remove, **update): | ||
""" | ||
See https://stackoverflow.com/questions/2059482#34333710 | ||
Temporarily updates the ``os.environ`` dictionary in-place. | ||
The ``os.environ`` dictionary is updated in-place so that the modification | ||
is sure to work in all situations. | ||
:param remove: Environment variables to remove. | ||
:param update: Dictionary of environment variables and values to add/update. | ||
""" | ||
env = os.environ | ||
update = update or {} | ||
remove = remove or [] | ||
|
||
# List of environment variables being updated or removed. | ||
stomped = (set(update.keys()) | set(remove)) & set(env.keys()) | ||
# Environment variables and values to restore on exit. | ||
update_after = {k: env[k] for k in stomped} | ||
# Environment variables and values to remove on exit. | ||
remove_after = frozenset(k for k in update if k not in env) | ||
|
||
try: | ||
env.update(update) | ||
[env.pop(k, None) for k in remove] | ||
yield | ||
finally: | ||
env.update(update_after) | ||
[env.pop(k) for k in remove_after] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters