Page 1 of 1

Feature request: time limit reset.

Posted: 2016-01-31T14:17:51-07:00
by Danack
This is a feature request to make calls to set the time resource limit be from 'now' rather than it being limit from the time when the first image was processed. i.e. MagickSetResourceLimit(TimeResource, 45); would set the time limit be 45 second from now.

That would be following the model used by PHP's set_time_limit()

The reason I want this is as follows. I have a webserver that uses ImageMagick (through Imagick) to process images. For security and performance reasons, I don't make calls to ImageMagick/Imagick directly from the web-server, but instead have a background task that does the image processing.

Some pseudo-code for the background image processor looks like this:

Code: Select all

$endTime = now() + 3600;
while (time() < $endTime) {
     $imageTask = waitForImageTask();
     $imageProcessor->generateImage($imageTask);
}
I want a limit on the maximum time each single image will take to be processed of 45 seconds. However I also want the image processor to stay up an processing images for longer than 45 seconds at a time. If calling `MagickSetResourceLimit(TimeResource, 45);` from within 'run loop' reset the time limit, that would be lovely.

cheers
Dan

Original discussion:

https://github.com/ImageMagick/ImageMag ... -177600827

Re: Feature request: time limit reset.

Posted: 2016-01-31T14:36:50-07:00
by magick
Thanks for the feature request. We have a patch to to support your feature request in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: Feature request: time limit reset.

Posted: 2016-02-24T08:14:07-07:00
by Danack
Hi,

I'd just like to check the exact implementation. Please could you give me a link to the commit that added this?

cheers
Dan

Re: Feature request: time limit reset.

Posted: 2016-03-11T13:10:34-07:00
by emcconville