How to properly end cgi App

Hi,

I have successfully deployed my first web app. Basically it a wizard form.

My question is what is the correct way to end it. I have it running in a frame on our drupal site. I noticed running top my app is sitting there at around 8% cpu and the time is 33:51:00. I’m sure it’s not in use at the moment.

So how do I exit it properly, both ate end of completion and if the user leaves it unattended.

What command will remove it from memory so it’s not in the process list?

Thanks

[quote=89570:@Richard Albrecht]Hi,

I have successfully deployed my first web app. Basically it a wizard form.

My question is what is the correct way to end it. I have it running in a frame on our drupal site. I noticed running top my app is sitting there at around 8% cpu and the time is 33:51:00. I’m sure it’s not in use at the moment.

So how do I exit it properly, both ate end of completion and if the user leaves it unattended.

What command will remove it from memory so it’s not in the process list?

Thanks[/quote]

App.Quit

… But why do you ask twice ?

How do I tell if it’s been inactive?

The other one was that I saw it in the list and wasn’t able to copy new file because it was busy.

Now what to do if Inactive?

And if I call app quit I could goto another page by calling Showurl first correct.

[quote=89582:@Richard Albrecht]How do I tell if it’s been inactive?

The other one was that I saw it in the list and wasn’t able to copy new file because it was busy.

Now what to do if Inactive?

And if I call app quit I could goto another page by calling Showurl first correct.[/quote]

Seems you are mixing several issues here :

  • File busy when you need to upgrade ; kill the process(es) as you have done. Phillip Zedalis suggests a nice way of dealing with upgrades in his blog. Normally, this is not everyday.

  • Program inactivity. You set up a timer that does what has to be done after a while of inactivity (shut down, send or receive email, whatever maintenance stuff…). In every event of your program you use, restart the timer. While the program is in use, the timer keeps being restarted so its action never comes up. When no event fires, the action event of the timer fires, and what you want to happen in inactivity occurs.

Now, should an app systematically be shut down after x minutes of inactivity ? If you operate a site where visitors come at random, it can happen that a user starts a session and gets shut down. Looks bad. If you want to keep your processes tidy, maybe it is better instead to kill all processes and shut down the app in the middle of the night when no visitor will be there.

  • ShowURL before shut down. Yes, that works and gives you a chance to redirect a visitor to a static HTML page before calling App.quit

Thanks great response. Where would I find Phillip Zedalis blog?

I knew a timer would be the way to go, just hadn’t figured out the details.

Thanks!

Haven’t you noticed ? He posted it in the other thread you started about upgrade : http://1701software.com/blog/upgrading_xojo_cgi_apps.php