From d826f7542bed5a0de553f7d85e76c16989cbeb84 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com> Date: Thu, 24 May 2018 12:02:11 +0200 Subject: [PATCH] swh.storage.api.client: Permit to specify the query timeout option Related T1061 --- debian/control | 4 ++-- requirements-swh.txt | 2 +- swh/storage/api/client.py | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/control b/debian/control index d30fc5864..e8480ea59 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,7 @@ Build-Depends: debhelper (>= 9), python3-requests, python3-setuptools, python3-sqlalchemy (>= 1.0), - python3-swh.core (>= 0.0.37~), + python3-swh.core (>= 0.0.40~), python3-swh.model (>= 0.0.18~), python3-swh.objstorage (>= 0.0.17~), python3-swh.scheduler (>= 0.0.14~), @@ -25,7 +25,7 @@ Homepage: https://forge.softwareheritage.org/diffusion/DSTO/ Package: python3-swh.storage Architecture: all -Depends: python3-swh.core (>= 0.0.28~), +Depends: python3-swh.core (>= 0.0.40~), python3-swh.model (>= 0.0.18~), python3-swh.objstorage (>= 0.0.17~), ${misc:Depends}, diff --git a/requirements-swh.txt b/requirements-swh.txt index 85ad7ed4c..493e4b319 100644 --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,4 +1,4 @@ -swh.core >= 0.0.37 +swh.core >= 0.0.40 swh.model >= 0.0.18 swh.objstorage >= 0.0.17 swh.scheduler >= 0.0.14 diff --git a/swh/storage/api/client.py b/swh/storage/api/client.py index e2157a616..5a38d0feb 100644 --- a/swh/storage/api/client.py +++ b/swh/storage/api/client.py @@ -11,8 +11,9 @@ from ..exc import StorageAPIError class RemoteStorage(SWHRemoteAPI): """Proxy to a remote storage API""" - def __init__(self, url): - super().__init__(api_exception=StorageAPIError, url=url) + def __init__(self, url, timeout=None): + super().__init__( + api_exception=StorageAPIError, url=url, timeout=timeout) def check_config(self, *, check_write): return self.post('check_config', {'check_write': check_write}) -- GitLab