Sha256: 934b1b8caf896661b7ecab4e2ea1ddd62b6e89725f75faba81dce5bd293e0612
Contents?: true
Size: 740 Bytes
Versions: 2
Compression:
Stored size: 740 Bytes
Contents
# frozen_string_literal: true require "concurrent/timer_task" require "caddy/version" require "caddy/task_observer" require "caddy/cache" module Caddy class << self attr_accessor :error_handler end @started_pid = nil @caches = Hash.new { |h, k| h[k] = Caddy::Cache.new(k) } def self.[](k) @caches[k] end def self.caches @caches end def self.start if !@started_pid @started_pid = $$ elsif @started_pid && $$ != @started_pid raise "Please run `Caddy.start` *after* forking, as the refresh thread will get killed after fork" end @caches.values.each(&:start).all? end def self.stop @caches.values.each(&:stop).all? end def self.restart stop start end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
caddy-1.5.1 | lib/caddy.rb |
caddy-1.5.0 | lib/caddy.rb |