foreman-tasks 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -74,7 +74,7 @@ code somewhere in Rails initialization process. In case of an engine,
74
74
  it would be:
75
75
 
76
76
  ```ruby
77
- initializer "your_engine.dynflow_initialize" do |app|
77
+ initializer "your_engine.require_dynflow", :before => "foreman_tasks.initialize_dynflow" do |app|
78
78
  ForemanTasks.dynflow.require!
79
79
  end
80
80
  ```
@@ -31,6 +31,10 @@ module ForemanTasks
31
31
  def initialize!
32
32
  return unless @required
33
33
  return @world if @world
34
+
35
+ if config.lazy_initialization && defined? PhusionPassenger
36
+ config.dynflow_logger.warn("ForemanTasks: lazy loading with PhusionPassenger might lead to unexpected results")
37
+ end
34
38
  config.initialize_world.tap do |world|
35
39
  @world = world
36
40
 
@@ -28,7 +28,7 @@ module ForemanTasks
28
28
 
29
29
  # to enable async Foreman operations using Dynflow
30
30
  if ENV['FOREMAN_TASKS_MONKEYS'] == 'true'
31
- initializer "foreman_tasks.dynflow_initialize" do |app|
31
+ initializer "foreman_tasks.require_dynflow", :before => "foreman_tasks.initialize_dynflow" do |app|
32
32
  ForemanTasks.dynflow.require!
33
33
  end
34
34
 
@@ -39,8 +39,18 @@ module ForemanTasks
39
39
  end
40
40
  end
41
41
 
42
- initializer "foreman_tasks.initialize_dynflow", :after => :finisher_hook do
43
- ForemanTasks.dynflow.initialize! unless ForemanTasks.dynflow.config.lazy_initialization
42
+ initializer "foreman_tasks.initialize_dynflow" do
43
+ unless ForemanTasks.dynflow.config.lazy_initialization
44
+ if defined?(PhusionPassenger)
45
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
46
+ if forked
47
+ ForemanTasks.dynflow.initialize!
48
+ end
49
+ end
50
+ else
51
+ ForemanTasks.dynflow.initialize!
52
+ end
53
+ end
44
54
  end
45
55
 
46
56
  rake_tasks do
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-27 00:00:00.000000000 Z
12
+ date: 2014-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails