Sha256: cc9322a7ea27d10dd3378abcdbb52d1b77a2436f38648415cc3cf1d0fc17b7a0
Contents?: true
Size: 953 Bytes
Versions: 5
Compression:
Stored size: 953 Bytes
Contents
module Beanstalker class DaemonizerHandler < Daemonizer::Handler def prepare(starter, &block) logger.info "Loading Rails" require File.join(Daemonizer.root, '/config/environment') require 'beanstalker/worker' logger.info "Rails loaded" super end def start $logger = logger $logger.info "Starting cycle" if option(:error_handler) Worker.custom_error_handler = option(:error_handler) end if option(:timeout_handler) Worker.custom_timeout_handler = option(:timeout_handler) end @worker = Worker.new(binding, :tube => option(:tube), :servers => option(:servers), :worker_id => worker_id, :workers_count => workers_count, :ruby_timeout => option(:ruby_timeout).nil? ? true : option(:ruby_timeout)) @worker.run $logger.info "Ending cycle" end end end
Version data entries
5 entries across 5 versions & 1 rubygems