From 0aabd0a6a52d27a52b44eca1da8a51af0494d1bf Mon Sep 17 00:00:00 2001 From: Artur Gaspar Date: Mon, 18 Dec 2023 12:41:37 -0300 Subject: [PATCH 1/2] feat: valid S3 expiration time --- recommender/recommender.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recommender/recommender.py b/recommender/recommender.py index d1e2ad2..f4ce74c 100644 --- a/recommender/recommender.py +++ b/recommender/recommender.py @@ -285,7 +285,10 @@ def _get_onetime_url(self, filename): We benchmarked this as less than 8ms on a sandbox machine. """ if filename.startswith('fs://'): - return str(self.fs.get_url(filename.replace('fs://', ''), 1000 * 60 * 60 * 10)) + # 604800 seconds is the maximum allowed expiration by S3. + # If this is instead filesystem-backed, the timeout argument has + # no effect. + return str(self.fs.get_url(filename.replace('fs://', ''), 604800)) else: return filename From e99a9c8a6884c779b9a40b900b6db204bf4d693a Mon Sep 17 00:00:00 2001 From: Artur Gaspar Date: Mon, 22 Jan 2024 03:14:05 -0300 Subject: [PATCH 2/2] chore: bump version --- recommender/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recommender/__init__.py b/recommender/__init__.py index 40dad5f..31462d1 100644 --- a/recommender/__init__.py +++ b/recommender/__init__.py @@ -6,4 +6,4 @@ # which is not loaded when running `manage.py` commands (which is used by `make compile_translations`) # from .recommender import RecommenderXBlock -__version__ = '2.1.0' +__version__ = '2.1.1'