Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: valid S3 expiration time #75

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recommender/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
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
Loading