Skip to content

Commit

Permalink
feat: valid S3 expiration time
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturGaspar committed Dec 18, 2023
1 parent d32e7e4 commit 0aabd0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion recommender/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0aabd0a

Please sign in to comment.