heezy has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I have a CGI script that trundles through a huge directory of pdf files and retitles them based on values in a mySQL database. As it runs it outputs the old and new titles of the pdf's to the users browser. This takes approx 15 mins to complete
At the moment it is possible for more than one person to run the script at a time as all they have to do is point their browser in the right direction.
Does anyone have a cunning Perl-ish way of locking out the script so that it can only be run by one person at a time?
I thought of using a flag in a config file for the script but this could cause problems if the user clicked stop on their browser and the first invocation of the script never finishes (i.e. never releases the lock)
Ideas on this would be a great help
thanks all,
m
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Locking out a CGI script whilst it runs
by merlyn (Sage) on Feb 18, 2003 at 20:39 UTC | |
|
Re: Locking out a CGI script whilst it runs
by steves (Curate) on Feb 18, 2003 at 20:23 UTC | |
|
Re: Locking out a CGI script whilst it runs
by Ryszard (Priest) on Feb 18, 2003 at 20:27 UTC | |
|
Re: Locking out a CGI script whilst it runs
by jasonk (Parson) on Feb 18, 2003 at 20:04 UTC | |
by extremely (Priest) on Feb 18, 2003 at 21:18 UTC |