File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -390,12 +390,11 @@ internal struct LambdaHTTPServer {
390390            logger [ metadataKey:  " requestId " ]  =  " \( requestId) " 
391391
392392            logger. trace ( " /invoke received invocation, pushing it to the pool and wait for a lambda response " ) 
393-             // detect concurrent invocations of POST and gently decline the requests while we're processing one.
394393            self . invocationPool. push ( LocalServerInvocation ( requestId:  requestId,  request:  body) ) 
395394
396395            // wait for the lambda function to process the request
397-             // when POST /invoke is called multiple times before a response is process, the  
398-             // `for try await ... in` loop will throw an error and we will return a 400 error to the client
396+             // when POST /invoke is called multiple times before a response is processed, 
397+             // the  `for try await ... in` loop will throw an error and we will return a 400 error to the client
399398            do  { 
400399                for  try await  response  in  self . responsePool { 
401400                    logger [ metadataKey:  " response requestId " ]  =  " \( response. requestId ??  " nil " ) " 
@@ -427,6 +426,7 @@ internal struct LambdaHTTPServer {
427426                // This should not happen as the async iterator blocks until there is a response to process
428427                fatalError ( " No more responses to process - the async for loop should not return " ) 
429428            }  catch  is LambdaHTTPServer . Pool < LambdaHTTPServer . LocalServerResponse > . PoolError  { 
429+                 // detect concurrent invocations of POST and gently decline the requests while we're processing one.
430430                let  response  =  LocalServerResponse ( 
431431                    id:  requestId, 
432432                    status:  . badRequest, 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments