senotrusov-ruby-daemonic-threads 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,7 @@ class DaemonicThreads::Config
28
28
  config["class-constantized"] = config["class"].constantize
29
29
  end
30
30
 
31
- Rails.logger.debug("#{self.class}#initialize -- Configuration: #{self.inspect}") if Rails.logger.debug?
31
+ Rails.logger.debug {"#{self.class}#initialize -- Configuration: #{self.inspect}"}
32
32
  end
33
33
 
34
34
  attr_reader :queue_names, :daemons
@@ -213,7 +213,7 @@ class DaemonicThreads::HTTP::HttpRequest
213
213
 
214
214
 
215
215
  def log! logger, severity = :fatal, title = nil
216
- logger.__send__(severity, "#{title} -- #{self.inspect rescue "EXCEPTION CALLING inspect()"}\n -- Request body: #{body.inspect rescue "EXCEPTION CALLING body()"}")
216
+ logger.__send__(severity) {"#{title} -- #{self.inspect rescue "EXCEPTION CALLING inspect()"}\n -- Request body: #{body.inspect rescue "EXCEPTION CALLING body()"}"}
217
217
  logger.flush if logger.respond_to?(:flush)
218
218
  end
219
219
 
@@ -107,8 +107,8 @@ module DaemonicThreads::Prototype
107
107
 
108
108
 
109
109
  def perform_initialize_daemon(*args)
110
- initialize_daemon(*args) if respond_to? :initialize_daemon
111
110
  initialize_http if respond_to?(:initialize_http)
111
+ initialize_daemon(*args) if respond_to? :initialize_daemon
112
112
  end
113
113
 
114
114
 
@@ -192,7 +192,7 @@ module DaemonicThreads::Prototype
192
192
 
193
193
 
194
194
  def log severity, message = nil
195
- @logger.__send__(severity, "#{self.class}##{caller.first.match(/`(.*)'/)[1]} -- #{block_given? ? yield : message}" )
195
+ @logger.__send__(severity) {"#{self.class}##{caller.first.match(/`(.*)'/)[1]} -- #{block_given? ? yield : message}"}
196
196
  end
197
197
 
198
198
  end
@@ -87,7 +87,7 @@ class DaemonicThreads::Runner
87
87
  return if @must_terminate
88
88
  @restarting = false
89
89
 
90
- @logger.info "#{self.class}#watchdog @name:`#{@name}' -- Starting..."
90
+ @logger.info {"#{self.class}#watchdog @name:`#{@name}' -- Starting..."}
91
91
  @daemon = @config["class-constantized"].new(@name, self)
92
92
  end
93
93
 
@@ -107,7 +107,7 @@ class DaemonicThreads::Runner
107
107
  def delay
108
108
  @mutex.synchronize do
109
109
  unless @must_terminate
110
- @logger.info "#{self.class}#delay @name:`#{@name}' -- Catch termination, restarting in #{RESTART_DELAY} seconds..."
110
+ @logger.info {"#{self.class}#delay @name:`#{@name}' -- Catch termination, restarting in #{RESTART_DELAY} seconds..."}
111
111
 
112
112
  Thread.new_with_exception_handling(lambda { @process.controller.stop }, @logger, :fatal, "#{self.class}#delay @name:`#{@name}'") do
113
113
  # Если кто-то пошлёт сигнал во время сна, ожидающий получит два сигнала по пробуждении. В этом конкретном случае это не ппроблема, потому как этот кто-то - это стоп, и после него получать сигнал будет некому
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: senotrusov-ruby-daemonic-threads
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav Senotrusov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-01 00:00:00 -07:00
12
+ date: 2009-08-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency