Skip to content

Commit 0785929

Browse files
author
Michael Hammann
committed
feat: depends_on flag needs now to be used with group:process if process is in group or just process if process is not assigned to any group
1 parent d9b897d commit 0785929

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

supervisor/supervisord.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ def run(self):
8989
g = Graph(len(self.options.process_group_configs))
9090
# replace depends_on string with actual process object
9191
for config in (self.options.process_group_configs):
92-
depends_on = config.process_configs[0].depends_on
92+
# this can be of form group:process or simply process
93+
try:
94+
dependent_group, dependent_process=depends_on.split(":")
95+
except:
96+
dependent_group=dependent_process=depends_on
9397
if config.process_configs[0].depends_on is not None:
94-
g.addEdge(config.process_configs[0].name, config.process_configs[0].depends_on)
95-
config.process_configs[0].depends_on = self.process_groups[depends_on].processes[depends_on]
98+
g.addEdge(config.process_configs[0].name, dependent_process)
99+
config.process_configs[0].depends_on = self.process_groups[dependent_group].processes[dependent_process]
96100
# check for cyclical process dependencies
97101
if g.cyclic() == 1:
98102
raise AttributeError('Process config contains dependeny cycle(s)! Check config files again!')

0 commit comments

Comments
 (0)