I'm facing problem with uploading files, randomly it stops with different kind of errors: Unable to make data connection at Socket. (/aaa/node_modules/ftp/lib/connection.js:935:10) or Error: Client aborted. Sometimes it works when launched e.g. 10 times
var deployPaths =
{
    'aaa/public_html': [],
    'bbb/public_html': [],
};
var defaultTasks = [];
function deployMultiple(key) {
    var conn = ftp.create({
        host: 'site',
        user: 'xxxx',
        password: 'xxxxxx',
        parallel: 10,
        maxConnections: 5,
        log: plugins.util.log
    });
    var globs = [
        path + '/some_path/**',
        '!' + path + '/some_path/aa/**',
        '!' + path + '/some_path/bb/**',
        path + '/administrator/some_path/**',
    ];
    // using base = '.' will transfer everything to /public_html correctly
    // turn off buffering in gulp.src for best performance
    return gulp.src(globs, {base: path, buffer: false})
        .pipe(conn.newer(key)) // only upload newer files
        .pipe(conn.dest(key));
}
gulp.task('deploy-task', function (cb) {
    for (var key in deployPaths) {
        deployMultiple(key);
        cb();
    }
});
gulp.task('deploy',gulp.series('clean','git_export','deploy-task'));
Please help, Thank you