Sha256: 04bcbb02329cf943472a2542c725e3e8f15496aa8eae780714d722442776d8df
Contents?: true
Size: 633 Bytes
Versions: 26
Compression:
Stored size: 633 Bytes
Contents
require 'net/http' class HttpEvictCache < Filbunke::Callbacks def on_update(file) begin evict_http = Net::HTTP.new(@config["host"], @config["port"].to_i) evict_http.start do |http| evict_path = "/cache/evict/#{file.path.chomp('.yml')}" request = Net::HTTP::Get.new(evict_path) response = http.request(request) if response.code.to_i != 200 @logger.log "Failed to evict cache entry: #{file.path}" end end rescue StandardError => e @logger.log("Failed to evict cache entry: #{file.path}") @logger.log(e.backtrace.join("\n")) end end end
Version data entries
26 entries across 26 versions & 1 rubygems