mirror of
https://github.com/Neetpone/foalfetch.git
synced 2025-02-08 18:06:43 +01:00
14 lines
287 B
Ruby
14 lines
287 B
Ruby
# frozen_string_literal: true
|
|
|
|
ENV['REDIS_HOST'] ||= 'localhost'
|
|
|
|
# require 'hiredis'
|
|
require 'redis'
|
|
|
|
$redis = Redis.new(host: ENV['REDIS_HOST'])
|
|
|
|
if defined?(PhusionPassenger)
|
|
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
|
$redis.disconnect! if forked
|
|
end
|
|
end
|