Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins using through2.obj are limited to 16 files by default #716

Closed
fabiendem opened this issue Oct 8, 2014 · 4 comments
Closed

Plugins using through2.obj are limited to 16 files by default #716

fabiendem opened this issue Oct 8, 2014 · 4 comments

Comments

@fabiendem
Copy link

Hello,

I am facing an issue with the plugin gulp-ftp, posted it in the issues of the repo and got redirected here. (See: https://github.com/sindresorhus/gulp-ftp/issues/25).

Here is a copy paste of the problem description:

I am trying to upload 25 files but only 16 files are uploaded via the plugin.
If I use the plugin gulp-using, I can see that the 25 files are passed to the ftp plugin :

gulp.src('dist/**/*.*')
        .pipe($.using())
        .pipe($.ftp(...})

But If in the index.js of the plugin I log the files going through through2:

...
return through.obj({highWaterMark: 32}, function (file, enc, cb) {
        ====> gutil.log(file.path);

        if (file.isNull()) {
            cb(null, file);
            return;
        }
...

I get only the first 16 files.

If I increase the highWaterMark option, all the files are uploaded:

....
return through.obj({highWaterMark: 32}, function (file, enc, cb) {
....

So basically the highWaterMark option is currently not dynamic, that's what I understand...
I am not sure it's the role of gulp to deal with this but I transfer the issue as advised by @sindresorhus

Thanks

@yocontra
Copy link
Member

yocontra commented Oct 9, 2014

You need something consuming the stream. Make sure you are returning the stream for the task or consuming it yourself otherwise it will pause when the watermark is hit

@fabiendem
Copy link
Author

Thanks !

If I consume it with a simple .size() from gulp-size it's working.

gulp.src('dist/**/*.*')
        .pipe($.ftp({
            host: ftpCredentials.host,
            user: ftpCredentials.user,
            pass: ftpCredentials.pass,
            remotePath : remotePath
        }))
        .pipe($.size());

@yocontra
Copy link
Member

yocontra commented Oct 9, 2014

You should open an issue on gulp-ftp to fix this

@wbswjc
Copy link

wbswjc commented Oct 28, 2017

I've spent a whole night trying to figure this out, many thanks @fabiendem

I made a sewer for gulp pipe like this..

.pipe(gulp.dest('./temp/sewer')

[01:48:51] CLI version 1.4.0
[01:48:51] Local version 4.0.0-alpha.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants