Sha256: 2a77276a8e6b1140b277358b923492b2f7cd972ca5b8488425c3b9f62e589e1e
Contents?: true
Size: 574 Bytes
Versions: 24
Compression:
Stored size: 574 Bytes
Contents
require 'routemaster/cache' require 'routemaster/dirty/map' module Routemaster module Jobs # Caches a URL using {Cache} and sweeps the dirty map if successful. # Busts the cache if the resource was deleted. class CacheAndSweep def perform(url) Dirty::Map.new.sweep_one(url) do begin cache.get(url) rescue Errors::ResourceNotFound cache.bust(url) true end end end private def cache @cache ||= Routemaster::Cache.new end end end end
Version data entries
24 entries across 24 versions & 1 rubygems