File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -173,17 +173,12 @@ def ordered_stop_groups_phase_2(self):
173173
174174 def runforever (self ):
175175 events .notify (events .SupervisorRunningEvent ())
176+ timeout = 1 # this cannot be fewer than the smallest TickEvent (5)
176177 first_poll = True
177178
178179 socket_map = self .options .get_socket_map ()
179180
180181 while 1 :
181- if first_poll :
182- timeout = 0
183- first_poll = False
184- else :
185- timeout = 1 # this cannot not be fewer than the smallest TickEvent (5)
186-
187182 combined_map = {}
188183 combined_map .update (socket_map )
189184 combined_map .update (self .get_process_map ())
@@ -212,7 +207,12 @@ def runforever(self):
212207 if dispatcher .writable ():
213208 self .options .poller .register_writable (fd )
214209
215- r , w = self .options .poller .poll (timeout )
210+ if first_poll :
211+ # initial timeout of 0 avoids delaying supervisord startup
212+ r , w = self .options .poller .poll (0 )
213+ first_poll = False
214+ else :
215+ r , w = self .options .poller .poll (timeout )
216216
217217 for fd in r :
218218 if fd in combined_map :
You can’t perform that action at this time.
0 commit comments