gm icon indicating copy to clipboard operation
gm copied to clipboard

Need a way to abort a long running write operation

Open bbrown-extensis opened this issue 5 years ago • 0 comments

gm.subClass({ imageMagick: true })(inputPath).resize(1024, 1024).write(path, err => {
  if (err) {
    console.log(err);
  } else {
    console.log('success');
  }
});

If this is a microservice handling a request and the request times out, there is no way to stop the underlying imagemagick process. It keep on going and taking up resources. There is an undocumented timeout option, but would much prefer to be able to shutdown on an external event. Perhaps expose the underlying _spawn.

bbrown-extensis avatar Sep 17 '20 23:09 bbrown-extensis