From fbb0eaa43f2c29eeece40c7a06a776c83d6621e1 Mon Sep 17 00:00:00 2001 From: Kliment Mamykin Date: Sun, 17 Apr 2011 05:17:26 -0400 Subject: [PATCH] Removing extra invalidation request sneaked in after a merge Also always logging when pushing a file to S3 --- lib/jammit/s3_uploader.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/jammit/s3_uploader.rb b/lib/jammit/s3_uploader.rb index 916061a..4974164 100644 --- a/lib/jammit/s3_uploader.rb +++ b/lib/jammit/s3_uploader.rb @@ -90,21 +90,16 @@ def upload_from_glob(glob) new_object.content = open(local_path) new_object.content_encoding = "gzip" if use_gzip new_object.acl = @acl if @acl + log "pushing file to s3: #{remote_path}" new_object.save - + if Jammit.configuration[:use_cloudfront] && obj - log "updating the file on s3 and cloudfront: #{remote_path}" - @changed_files << remote_path - else - log "pushing file to s3: #{remote_path}" + log "File changed and will be invalidated in cloudfront: #{remote_path}" + @changed_files << remote_path end else log "file has not changed: #{remote_path}" - end - end - if Jammit.configuration[:use_cloudfront] && !@changed_files.empty? - log "invalidating cloudfront cache for changed files" - invalidate_cache(@changed_files) + end end end