Resampling images -- need lock ?
| From: | Martin Zvarík | Date: | Mon, 20 Apr 2009 12:42:00 +0000 |
| Subject: | Resampling images -- need lock ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-291677@lists.php.net to get a copy of this message | ||
I have 10 images of different sizes.
If user clicks ROTATE, a script will go through all these 10 images and rotates them.
If the user clicks TWICE, the first script will get aborted in the middle (so few images are already rotated) and then the second request will rotate all of them again.
I probably need to write a script that would lock the first file and if this file is already locked it would just die('already working...')
Is this a good approach?
I know I can use javascript to disable second click, but I want it server side.
Thanks for your suggestions,
Martin