Skip to content

Commit e476ce2

Browse files
committed
feat: add connection retries by default
1 parent eaee6ad commit e476ce2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ from sqlite_s3_query import sqlite_s3_query
181181

182182
query_my_db = partial(sqlite_s3_query,
183183
url='https://my-bucket.s3.eu-west-2.amazonaws.com/my-db.sqlite',
184-
get_http_client=lambda: httpx.Client(),
184+
get_http_client=lambda: httpx.Client(transport=httpx.HTTPTransport(retries=3)),
185185
)
186186

187187
with \

sqlite_s3_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def sqlite_s3_query_multi(url, get_credentials=lambda now: (
2020
os.environ['AWS_ACCESS_KEY_ID'],
2121
os.environ['AWS_SECRET_ACCESS_KEY'],
2222
os.environ.get('AWS_SESSION_TOKEN'), # Only needed for temporary credentials
23-
), get_http_client=lambda: httpx.Client(),
23+
), get_http_client=lambda: httpx.Client(transport=httpx.HTTPTransport(retries=3)),
2424
get_libsqlite3=lambda: cdll.LoadLibrary(find_library('sqlite3'))):
2525
libsqlite3 = get_libsqlite3()
2626
libsqlite3.sqlite3_errstr.restype = c_char_p

0 commit comments

Comments
 (0)