@@ -240,24 +240,6 @@ func (ti *TypingsInstaller) invokeRoutineToInstallTypings(
240240 packageNames []string ,
241241 success bool ,
242242 ) {
243- ti .pendingRunRequestsMu .Lock ()
244- pendingRequestsCount := len (ti .pendingRunRequests )
245- var nextRequest * PendingRequest
246- if pendingRequestsCount == 0 {
247- ti .inFlightRequestCount --
248- } else {
249- nextRequest = ti .pendingRunRequests [0 ]
250- if pendingRequestsCount == 1 {
251- ti .pendingRunRequests = nil
252- } else {
253- ti .pendingRunRequests = ti .pendingRunRequests [1 :]
254- }
255- }
256- ti .pendingRunRequestsMu .Unlock ()
257- if nextRequest != nil {
258- ti .invokeRoutineToInstallTypings (nextRequest )
259- }
260-
261243 if success {
262244 p .Logf ("ATA:: Installed typings %v" , packageNames )
263245 var installedTypingFiles []string
@@ -330,6 +312,24 @@ func (ti *TypingsInstaller) invokeRoutineToInstallTypings(
330312 Status : core .IfElse (success , "Success" , "Fail" ),
331313 }
332314 }
315+
316+ ti .pendingRunRequestsMu .Lock ()
317+ pendingRequestsCount := len (ti .pendingRunRequests )
318+ var nextRequest * PendingRequest
319+ if pendingRequestsCount == 0 {
320+ ti .inFlightRequestCount --
321+ } else {
322+ nextRequest = ti .pendingRunRequests [0 ]
323+ if pendingRequestsCount == 1 {
324+ ti .pendingRunRequests = nil
325+ } else {
326+ ti .pendingRunRequests = ti .pendingRunRequests [1 :]
327+ }
328+ }
329+ ti .pendingRunRequestsMu .Unlock ()
330+ if nextRequest != nil {
331+ ti .invokeRoutineToInstallTypings (nextRequest )
332+ }
333333 },
334334 )
335335}
0 commit comments