vrfs-743: dropped expire date for read to 20 years, as 25 years is too long for S3

This commit is contained in:
Jonathan Kolyer 2013-12-21 22:01:25 -06:00
parent d8a5dbd031
commit 8fa8895944
1 changed files with 4 additions and 2 deletions

View File

@ -213,13 +213,15 @@ class ApiMusicSessionsController < ApiController
:secret_access_key => SampleApp::Application.config.aws_secret_access_key)
bucket = s3.buckets[SampleApp::Application.config.aws_bucket]
expire = Time.now + 20.years
read_url = bucket.objects[uri].url_for(:read,
:expires => Time.now + 25.years,
:expires => expire,
:'response_content_type' => 'text/csv').to_s
@perfdata.update_attribute(:uri, read_url)
logger.debug("*** client can read url #{read_url}")
write_url = bucket.objects[uri].url_for(:write,
:expires => SampleApp::Application.config.perf_data_signed_url_timeout,
:expires => expire,
:'response_content_type' => 'text/csv').to_s
logger.debug("*** client can upload to url #{write_url}")
redirect_to write_url