From 0aabd0a6a52d27a52b44eca1da8a51af0494d1bf Mon Sep 17 00:00:00 2001 From: Artur Gaspar Date: Mon, 18 Dec 2023 12:41:37 -0300 Subject: [PATCH] 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