Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

Commit

Permalink
Merge pull request #160 from bundler/purge-order
Browse files Browse the repository at this point in the history
Purge memcached before fastly
  • Loading branch information
indirect committed Apr 30, 2016
2 parents f2b3a7d + 7e24378 commit 3a6d8b4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/bundler_api/cache.rb
Expand Up @@ -48,24 +48,22 @@ def purge_specs
/versions
/names
)
puts "Purging #{(keys + paths) * ', '}"
puts "Purging #{(keys + paths).join(', ')}"
responses = keys.map {|k| cdn_client.purge_key(k) }
responses += paths.map {|k| cdn_client.purge_path(k) }
verify_responses!(responses)
end

def purge_gem(name)
keys = %w()
purge_memory_cache(name)

paths = %W(
/quick/Marshal.4.8/#{name}.gemspec.rz
/gems/#{name}.gem
/info/#{name}
)
puts "Purging #{(keys + paths) * ', '}"
responses = keys.map {|k| cdn_client.purge_key(k) }
responses += paths.map {|k| cdn_client.purge_path(k) }

purge_memory_cache(name)
puts "Purging #{paths.join(', ')}"
responses = paths.map {|k| cdn_client.purge_path(k) }

verify_responses!(responses)
end
Expand Down

0 comments on commit 3a6d8b4

Please sign in to comment.