pybiolib 1.1.1569__py3-none-any.whl → 1.1.1571__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- biolib/biolib_binary_format/remote_endpoints.py +12 -10
- {pybiolib-1.1.1569.dist-info → pybiolib-1.1.1571.dist-info}/METADATA +1 -1
- {pybiolib-1.1.1569.dist-info → pybiolib-1.1.1571.dist-info}/RECORD +6 -6
- {pybiolib-1.1.1569.dist-info → pybiolib-1.1.1571.dist-info}/LICENSE +0 -0
- {pybiolib-1.1.1569.dist-info → pybiolib-1.1.1571.dist-info}/WHEEL +0 -0
- {pybiolib-1.1.1569.dist-info → pybiolib-1.1.1571.dist-info}/entry_points.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
import datetime
|
2
|
-
from urllib.parse import urlparse, parse_qs
|
1
|
+
from datetime import datetime, timedelta
|
2
|
+
# from urllib.parse import urlparse, parse_qs
|
3
3
|
|
4
4
|
from biolib.biolib_logging import logger
|
5
5
|
|
@@ -12,19 +12,21 @@ class RemoteJobStorageResultEndpoint(RemoteEndpoint):
|
|
12
12
|
self._job_id = job_id
|
13
13
|
self._job_auth_token = job_auth_token
|
14
14
|
self._expires_at = None
|
15
|
-
self.
|
15
|
+
self._presigned_url = None
|
16
16
|
|
17
17
|
def get_remote_url(self):
|
18
|
-
if not self.
|
19
|
-
self.
|
18
|
+
if not self._presigned_url or datetime.utcnow() > self._expires_at:
|
19
|
+
self._presigned_url = BiolibJobApi.get_job_storage_download_url(
|
20
20
|
job_auth_token=self._job_auth_token,
|
21
21
|
job_uuid=self._job_id,
|
22
22
|
storage_type='results'
|
23
23
|
)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
self._expires_at = datetime.utcnow() + timedelta(minutes=8)
|
25
|
+
# TODO: Use expires at from url
|
26
|
+
# parsed_url = urlparse(self._presigned_url)
|
27
|
+
# query_params = parse_qs(parsed_url.query)
|
28
|
+
# time_at_generation = datetime.datetime.strptime(query_params['X-Amz-Date'][0], '%Y%m%dT%H%M%SZ')
|
29
|
+
# self._expires_at = time_at_generation + timedelta(seconds=int(query_params['X-Amz-Expires'][0]))
|
28
30
|
logger.debug(f'Job "{self._job_id}" fetched presigned URL with expiry at {self._expires_at.isoformat()}')
|
29
31
|
|
30
|
-
return self.
|
32
|
+
return self._presigned_url
|
@@ -24,7 +24,7 @@ biolib/biolib_binary_format/base_bbf_package.py,sha256=vxRV4iKy0dXeDOlFWnMFI0hGn
|
|
24
24
|
biolib/biolib_binary_format/file_in_container.py,sha256=j1eEPRxf_ew8I6G8sDiiZZxn4Wx1ppagfM9K8zTDG4U,3591
|
25
25
|
biolib/biolib_binary_format/module_input.py,sha256=led2QhHeec_ymBPw5uEn3_3vJKI-1T8zrFQGqwEWLMY,2788
|
26
26
|
biolib/biolib_binary_format/module_output_v2.py,sha256=J5ZO5gCSeudpE12EVDrjYrNTS2DwgszY-SVXT7Qjuyg,5913
|
27
|
-
biolib/biolib_binary_format/remote_endpoints.py,sha256=
|
27
|
+
biolib/biolib_binary_format/remote_endpoints.py,sha256=aeW479pm4YQPF4hXYJoKfBq_auE1QW6r066HTcYRwOY,1447
|
28
28
|
biolib/biolib_binary_format/remote_stream_seeker.py,sha256=uyi6kJBU1C1DWfiuR0kRUQIY7nalG7ocgwgngd3Ul4U,1999
|
29
29
|
biolib/biolib_binary_format/saved_job.py,sha256=nFHVFRNTNcAFGODLSiBntCtMk55QKwreUq6qLX80dI4,1125
|
30
30
|
biolib/biolib_binary_format/stdout_and_stderr.py,sha256=WfUUJFFCBrtfXjuWIaRPiWCpuBLxfko68oxoTKhrwx8,1023
|
@@ -99,8 +99,8 @@ biolib/utils/cache_state.py,sha256=BFrZlV4XZIueIFzAFiPidX4hmwADKY5Y5ZuqlerF5l0,3
|
|
99
99
|
biolib/utils/multipart_uploader.py,sha256=PEorMsTNg5f72e3Y-KA3LrI-F6EAnsD9vENV-5EuiX0,9896
|
100
100
|
biolib/utils/seq_util.py,sha256=hudZ7o1LI7xdpjb1OFKPBZvGVxjiqKez8zMwjtWT0TY,3269
|
101
101
|
biolib/utils/zip/remote_zip.py,sha256=NCdUnVbGCv7SfXCI-yVU-is_OnyWmLAnVpIdSvo-W4k,23500
|
102
|
-
pybiolib-1.1.
|
103
|
-
pybiolib-1.1.
|
104
|
-
pybiolib-1.1.
|
105
|
-
pybiolib-1.1.
|
106
|
-
pybiolib-1.1.
|
102
|
+
pybiolib-1.1.1571.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
103
|
+
pybiolib-1.1.1571.dist-info/METADATA,sha256=GCYfZN1iDWCNkywGtwy9ueqTTcI4A2SxYSXs-fykT4o,1543
|
104
|
+
pybiolib-1.1.1571.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
105
|
+
pybiolib-1.1.1571.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
106
|
+
pybiolib-1.1.1571.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|