task-orchestrator 0.0.28 → 0.0.29
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.
- checksums.yaml +4 -4
- data/examples/parallel +10 -0
- data/lib/orchestrator/task.rb +2 -0
- data/lib/orchestrator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7627c23f7d1208e1ddd2a3fa32fd9276e7ab2132
|
4
|
+
data.tar.gz: 79b1fc621bd668c1e92d35315b06b863b66f6228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7105fddb75b9ce7708e3de2a96d4d9df880ca76059c6ebee82b1915dc02dae1989c351ef0b48787f7b8b8361b9a3fb1c083170b055fc008121b822aec6897235
|
7
|
+
data.tar.gz: 9e27ff6cadd9235c3a21111be3167444b8e2f0e806fe0dc9456eba1c7b9d7c8279e090371fbdb8a87c704995d286765e73e27577e8b5e9fa0bb2e00657f9e7cc
|
data/examples/parallel
CHANGED
@@ -14,3 +14,13 @@ orchestrator:
|
|
14
14
|
- command: echo 3
|
15
15
|
- command: echo 4
|
16
16
|
- command: echo 5
|
17
|
+
- type: parallel
|
18
|
+
parallel: 3
|
19
|
+
parallel_spawn_delay: 2
|
20
|
+
sleep: 0.1
|
21
|
+
scripts:
|
22
|
+
- command: date +%S
|
23
|
+
- command: date +%S
|
24
|
+
- command: date +%S
|
25
|
+
- command: date +%S
|
26
|
+
- command: date +%S
|
data/lib/orchestrator/task.rb
CHANGED
@@ -448,6 +448,7 @@ EOF
|
|
448
448
|
if step['type'].to_sym == :parallel and @on_week_days.map {|d| Time.now.send(d) }.find_index(true) and @on_month_days.find_index(Time.now.mday)
|
449
449
|
#Parallel
|
450
450
|
interval = step.has_key?('sleep') ? step['sleep'] : 1
|
451
|
+
parallel_spawn_delay = step.has_key?('parallel_spawn_delay') ? step['parallel_spawn_delay'] : 0.1
|
451
452
|
parallel_factor = step.has_key?('parallel') ? step['parallel'] : 1
|
452
453
|
@on_failure = step.has_key?('on_failure') ? step['on_failure'].to_sym : :finish
|
453
454
|
|
@@ -469,6 +470,7 @@ EOF
|
|
469
470
|
break if @on_failure == :wait and @statuses.find_index(false)
|
470
471
|
if parallel_factor > running_threads
|
471
472
|
@threads[index] = Thread.new { thread_wrapper(index, step['scripts'][index]) }
|
473
|
+
sleep parallel_spawn_delay if index < parallel_factor - 1
|
472
474
|
break
|
473
475
|
end
|
474
476
|
sleep interval
|
data/lib/orchestrator/version.rb
CHANGED