Skip to content

Commit

Permalink
Removing extra invalidation request sneaked in after a merge
Browse files Browse the repository at this point in the history
Also always logging when pushing a file to S3
  • Loading branch information
Kliment Mamykin committed Apr 17, 2011
1 parent edb3cd7 commit fbb0eaa
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/jammit/s3_uploader.rb
Expand Up @@ -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

Expand Down

0 comments on commit fbb0eaa

Please sign in to comment.