Skip to content

Conversation

@alxndrsn
Copy link

@alxndrsn
Copy link
Author

AppVeyor build is broken on NodeJS version 4. Node 4 hasn't been maintined since 2018, so can this failure be ignored?

@alxndrsn
Copy link
Author

An alternative approach might be to replace

        if (options.during.constructor.name === 'AsyncFunction') {                                                                                                           
          if (!seemsToExpectCallback) {                                                                                                                                      
            promiseOrResultMaybe = promiseOrResultMaybe.then(function(resultMaybe){                                                                                          
              didDuringFnAlreadyHalt = true;                                                                                                                                 
              proceed(undefined, resultMaybe);                                                                                                                               
            });//_∏_                                                                                                                                                         
          }//fi                                                                                                                                                               
          promiseOrResultMaybe.catch(function(e){ proceed(e); });//_∏_                                                                                                       
        } else {                                                                                                                                                             
          if (!seemsToExpectCallback) {                                                                                                                                      
            didDuringFnAlreadyHalt = true;                                                                                                                                   
            return proceed(undefined, promiseOrResultMaybe);                                                                                                                 
          }                                                                                                                                                                  
        } 

with

        if (!seemsToExpectCallback) {                                                                                                                                        
          try {                                                                                                                                                              
            const res = await promiseOrResultMaybe;                                                                                                                          
            didDuringFnAlreadyHalt = true;                                                                                                                                   
            return proceed(undefined, res);                                                                                                                                  
          } catch(err) {                                                                                                                                                     
            proceed(err);                                                                                                                                                    
          }                                                                                                                                                                  
        } 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL: transaction() doesn't guarantee use of a database transaction

2 participants