Giter Club home page Giter Club logo

Comments (3)

jedrichards avatar jedrichards commented on September 17, 2024

Hey. Yeah, I think exec buffers stdout and stderr before returning it to Node all in one go, whereas spawn will launch a new process and stream the output back to Node. The max buffer for exec is only 200*1024 bytes. In your rsyncwrapper options are you specifying any options that could cause it to return a lot of information back to Node in stdout (--progress or --stats for example)? That could be pushing you over the buffer limit ... ?

In any case it sounds like it might be a good idea to swap this over to spawn anyway. Feel free to fork and pull request, or else I'll add this to my to-do list! ^^

from rsyncwrapper.

bryanberger avatar bryanberger commented on September 17, 2024

Perhaps it was using the --dryRun option. Either way I was able to fix it by using spawn. The major difference is the complete callback, where spawn does not return a single callback, but instead allows you to listen on the data stream. By listening on exit you can safely determine the process completed with or without errors but it may be an architecture change for this package. Do you have any thoughts?

This is what I have which obviously ignores errors:

var process = spawn('rsync', args);

process.stdout.on('data', function (data) {
  console.log('stdout: ' + data);
});

process.stderr.on('data', function (data) {
  console.log('stderr: ' + data);
});

process.on('exit', function (code) {
  console.log('child process exited with code ' + code);
  callback(null,null,null,null);
});

from rsyncwrapper.

jedrichards avatar jedrichards commented on September 17, 2024

Great, thanks for the code! Fixed in 543b3a5.

from rsyncwrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.