lib/rest-ftp-daemon/worker.rb in rest-ftp-daemon-0.243.2 vs lib/rest-ftp-daemon/worker.rb in rest-ftp-daemon-0.245
- old
+ new
@@ -5,28 +5,30 @@
if Settings.newrelic_enabled?
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
end
- def initialize wid
+ def initialize wid, pool = nil
# Logger
@logger = RestFtpDaemon::LoggerPool.instance.get :workers
@log_worker_status_changes = true
# Worker name
- @wid = wid
+ #@wid = wid
+ @pool = pool
# Set thread context
+ Thread.current.thread_variable_set :pool, pool
Thread.current.thread_variable_set :wid, wid
Thread.current.thread_variable_set :started_at, Time.now
worker_status WORKER_STATUS_STARTING
end
protected
def log_context
{
- wid: @wid,
+ wid: Thread.current.thread_variable_get(:wid),
jid: Thread.current.thread_variable_get(:jid),
}
end
def start