When receiving data, the server freezes, sometimes when receiving other data, it gives only the result from the first function and hangs on the second

async.each(body, function (address, callback){ repository = address.slice(address.lastIndexOf('/')+1, address.length); cmd.get('git clone '+ address, function(data){ child_process.exec('git log --pretty=format:"%ae [%an]"', {cwd: repository}, function(err, stdout, stderr){ console.log(stdout); //выводимый результат на этом останавливается выполнение child_process.exec('rd '+repository+' /s /q', function(err, stdout, stderr){}); } )}) }, function(err){ // All tasks are done now } ); 
  • What is cmd (5th line)? - Dmitriy Simushev 2:49 pm
  • this is one of the modules that works with the command line - Alexander Bondarenko
  • Are you sure that everything hangs on you? You have no error handlers anywhere. It seems to me that you just at some point get an error, ignore it and do not call the callback function of one of the upper levels to return the result. As a result, you should make sure that you do not have an err object on any of the levels - Dmitriy Simushev

0