foreman-tasks 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/foreman_tasks/dynflow.rb +4 -0
- data/lib/foreman_tasks/engine.rb +13 -3
- data/lib/foreman_tasks/version.rb +1 -1
- metadata +2 -2
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.
|
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
|
|
data/lib/foreman_tasks/engine.rb
CHANGED
@@ -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.
|
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"
|
43
|
-
|
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
|
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.
|
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-
|
12
|
+
date: 2014-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|