File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,19 @@ func (g *generator) Generate() error {
7878}
7979
8080func (g * generator ) generateFromSignals () {
81+ var hasWatcher bool
82+ for _ , config := range g .Configs .Config {
83+ if config .Watch {
84+ hasWatcher = true
85+ break
86+ }
87+ }
88+
89+ // If none of the configs need to watch for events, don't watch for signals either
90+ if ! hasWatcher {
91+ return
92+ }
93+
8194 g .wg .Add (1 )
8295 go func () {
8396 defer g .wg .Done ()
@@ -163,6 +176,11 @@ func (g *generator) generateFromEvents() {
163176 var watchers []chan * docker.APIEvents
164177
165178 for _ , config := range configs .Config {
179+
180+ if ! config .Watch {
181+ continue
182+ }
183+
166184 g .wg .Add (1 )
167185
168186 go func (config Config , watcher chan * docker.APIEvents ) {
You can’t perform that action at this time.
0 commit comments