WSManage progress

We’ll, I’m making some progress getting rid of all the xajax stuff in WSManage. I’ve also changed the way the processing script is launched. I used to launch it directly from an ajax call, but the problem was tracking the script. Since everything was happening asynchronously, there is no way php can keep a file handle open on the process_queue script. If the script crashes, it’s hard to detect it properly.

To combat this, I’ve written a very very simple script that should never crash called process_queue_init. It’s only job is to start process_queue, grab the exit code when it exits, and set processing to false when it’s done. I’m using exec() to call process_queue, so execution of process_queue_init will just hang until process_queue exits. This way I can tell exactly when the script ended (without having to try to look through ps output) and whether or not it crashed. I have defined my own exit codes for different problems, and php always exits with code 255 if there is a scripting error.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: