factorylabs-delayed_job 1.8.2 → 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.2
1
+ 1.8.3
data/delayed_job.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{delayed_job}
8
- s.version = "1.8.2"
8
+ s.version = "1.8.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tobias L\303\274tke"]
@@ -46,19 +46,23 @@ module Delayed
46
46
  def daemonize
47
47
  worker_count.times do |worker_index|
48
48
  process_name = worker_count == 1 ? "delayed_job" : "delayed_job.#{worker_index}"
49
- FileUtils.mkdir_p "#{root_path}/tmp/pids"
50
- Daemons.run_proc(process_name, :dir => "#{root_path}/tmp/pids", :dir_mode => :normal, :ARGV => @args) do |*args|
49
+ FileUtils.mkdir_p "#{self.root_path}/tmp/pids"
50
+ Daemons.run_proc(process_name, :dir => "#{self.root_path}/tmp/pids", :dir_mode => :normal, :ARGV => @args) do |*args|
51
51
  run process_name
52
52
  end
53
53
  end
54
54
  end
55
55
 
56
56
  def run(worker_name = nil)
57
- Dir.chdir(root_path)
58
- require File.join(root_path, 'config', 'environment') if ENV['RAILS_ENV']
59
57
  self.instance_eval(&@configuration) if @configuration
58
+
59
+ Dir.chdir(self.root_path)
60
+ rails_environment = File.join(self.root_path, 'config', 'environment')
61
+ require rails_environment if File.exists?(rails_environment)
62
+
60
63
  # Replace the default logger
61
- logger = Logger.new(File.join(root_path, 'log', 'delayed_job.log'))
64
+ logger = Logger.new(File.join(self.root_path, 'log', 'delayed_job.log'))
65
+ logger.info "*** starting Delayed Job daemon ***"
62
66
  logger.level = ActiveRecord::Base.logger.level
63
67
  ActiveRecord::Base.logger = logger
64
68
  ActiveRecord::Base.clear_active_connections!
@@ -67,7 +71,7 @@ module Delayed
67
71
 
68
72
  Delayed::Worker.new(@options).start
69
73
  rescue => e
70
- logger.fatal e
74
+ logger.fatal e unless logger.nil?
71
75
  STDERR.puts e.message
72
76
  exit 1
73
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factorylabs-delayed_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Tobias L\xC3\xBCtke"