@@ -43,7 +43,7 @@ class DataSourceName:
4343 user : str
4444 password : str = attr .ib (repr = False )
4545 database : str
46- host : str = "localhost "
46+ host : str = "127.0.0.1 "
4747 port : int = 5432
4848
4949 # Attributes about the caller
@@ -60,14 +60,14 @@ def to_uri(self, with_query=False) -> str:
6060
6161
6262def create_pg_engine (dsn : DataSourceName , minsize : int = 1 , maxsize : int = 4 ):
63- """ Adapts the arguments of aiopg.sa.create_engine
63+ """Adapts the arguments of aiopg.sa.create_engine
6464
65- Returns a coroutine that is awaitable, i.e.
65+ Returns a coroutine that is awaitable, i.e.
6666
67- async with create_pg_engine as engine:
68- assert not engine.closed
67+ async with create_pg_engine as engine:
68+ assert not engine.closed
6969
70- assert engine.closed
70+ assert engine.closed
7171 """
7272 awaitable_engine_coro = create_engine (
7373 dsn .to_uri (),
@@ -154,8 +154,7 @@ def raise_http_unavailable_error(retry_state: RetryCallState):
154154
155155
156156class PostgresRetryPolicyUponInitialization :
157- """ Retry policy upon service initialization
158- """
157+ """Retry policy upon service initialization"""
159158
160159 WAIT_SECS = 5
161160 ATTEMPTS_COUNT = 20
@@ -172,8 +171,7 @@ def __init__(self, logger: Optional[logging.Logger] = None):
172171
173172
174173class PostgresRetryPolicyUponOperation :
175- """ Retry policy upon service operation
176- """
174+ """Retry policy upon service operation"""
177175
178176 WAIT_SECS = 2
179177 ATTEMPTS_COUNT = 3
@@ -195,8 +193,8 @@ def __init__(self, logger: Optional[logging.Logger] = None):
195193
196194
197195def retry_pg_api (func ):
198- """ Decorator to implement postgres service retry policy and
199- keep global statistics on service attempt fails
196+ """Decorator to implement postgres service retry policy and
197+ keep global statistics on service attempt fails
200198 """
201199 # TODO: temporary. For the time being, use instead postgres_service_retry_policy_kwargs
202200 _deco_func = retry (** postgres_service_retry_policy_kwargs )(func )
0 commit comments