Skip to content

Commit

Permalink
retry timeout errors in vault (#40)
Browse files Browse the repository at this point in the history
* retry timeout errors in vault

* fix lint

* i will not be defeated by a linter
  • Loading branch information
rtjoseph11 authored Dec 8, 2023
1 parent db16f6f commit b08e255
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions gestalt/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from time import sleep
from gestalt.provider import Provider
import requests
from requests.exceptions import Timeout
from jsonpath_ng import parse # type: ignore
from typing import Optional, Tuple, Any, Dict, Union, List
import hvac # type: ignore
Expand All @@ -12,7 +13,7 @@


class Vault(Provider):
@retry(exceptions=RuntimeError, delay=2, tries=5) # type: ignore
@retry((RuntimeError, Timeout), delay=2, tries=5) # type: ignore
def __init__(self,
cert: Optional[Tuple[str, str]] = None,
role: Optional[str] = None,
Expand Down Expand Up @@ -84,7 +85,7 @@ def stop(self) -> None:
def __del__(self) -> None:
self.stop()

@retry(RuntimeError, delay=3, tries=3) # type: ignore
@retry((RuntimeError, Timeout), delay=3, tries=3) # type: ignore
def get(
self,
key: str,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def readme():
reqs_list = list(map(lambda x: x.rstrip(), reqs))

setup(name='gestalt-cfg',
version='3.3.4',
version='3.3.5',
description='A sensible configuration library for Python',
long_description=readme(),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit b08e255

Please sign in to comment.