@@ -184,8 +184,11 @@ func startDefaultServices(b backend.Backend, wg *sync.WaitGroup, outchan chan st
184184 wg .Wait ()
185185
186186 // optimization: start all remaining services in the background
187+ // cache is a special case because it must start before registry
188+ b .Start ([]string {"cache" }, & _wg , _outchan , _errchan )
189+ wg .Wait ()
187190 b .Start ([]string {
188- "cache" , " database" , "registry@1" , "controller" , "builder" ,
191+ "database" , "registry@1" , "controller" , "builder" ,
189192 "publisher" , "router@1" , "router@2" , "router@3" },
190193 & _wg , _outchan , _errchan )
191194
@@ -269,7 +272,9 @@ func stopDefaultServices(b backend.Backend, wg *sync.WaitGroup, outchan chan str
269272 wg .Wait ()
270273
271274 outchan <- fmt .Sprintf ("Control plane..." )
272- b .Stop ([]string {"controller" , "builder" , "cache" , "database" , "registry@1" }, wg , outchan , errchan )
275+ b .Stop ([]string {"controller" , "builder" , "database" , "registry@1" }, wg , outchan , errchan )
276+ wg .Wait ()
277+ b .Stop ([]string {"cache" }, wg , outchan , errchan )
273278 wg .Wait ()
274279
275280 outchan <- fmt .Sprintf ("Logging subsystem..." )
0 commit comments