Limbic~Region has asked for the wisdom of the Perl Monks concerning the following question:
I am guessing the reason that they do not have the page automatically update the data pool itself is because there can only one be one copy of the external shell script running at any one time. The shell script checks to see if it is already running and it aborts if so. This could get complicated if multiple people are viewing the same web page. I know that the vendor COULD have figured out how to handle this, but the bottom line is they didn't.
I would like to change how often the external shell script runs in cron to only once or twice an hour since this web page doesn't get used very much. The problem is, when we do view it - there is the potential the data is a half hour old. My proposed solution is to add a button to the top of the page that says "Update", which would be a hook to call the external shell script - an update on demand if you will.
I know there is still a chance that two people will click the button at the exact same time - but it is reduced dramatically - especially considering we don't use it that often.
Since I am completely CGI illiterate and the vendor says, though I have permission to modify the code, they may choose to update at any time - how do I:
Waiting for the external script to finish is not absolutely critical since the page refreshes every 15 seconds and it will be updated as soon as the script is finished anyway.
Any/all help will be appreciated! - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: CGI Question - run external script and then update page
by merlyn (Sage) on Feb 06, 2003 at 01:00 UTC | |
|
Re: CGI Question - run external script and then update page
by tachyon (Chancellor) on Feb 06, 2003 at 01:30 UTC | |
|
Re: CGI Question - run external script and then update page
by bart (Canon) on Feb 06, 2003 at 11:05 UTC | |
|
Re: CGI Question - run external script and then update page
by Aristotle (Chancellor) on Feb 06, 2003 at 12:44 UTC |