Jump to content

User Stopping Script Half Way Through Processing


johnsmith153

Recommended Posts

I need to do various things where my script searches and updates various different tables in a database.

 

Some scripts action quite a lot of tables, and require 10 seconds of processing time approx.

 

If the user stopped the process part way through (clicked another link 5 seconds in etc.), or the server failed - I could have it where let's say only 2 of the 6 tables are updated.

 

Is this normal? Do I know what I am talking about? Is there a way around this?

 

Obviously you would get a corrupt database. Sometimes it is a minor thing - ie a forum post - but sometimes it can be more important (imagine if it was related to somebody's account balance on an online site etc.)

 

Why when the user clicks another link does the script stop processing on the server? Surely it should finish, then when it trys to return its response to the user, it would find the user has gone.

Never had this problem. You could always do a JS and lock the page stating "updating" but ultimately the user has control. And if JS is disabled that would not work.

 

But 10seconds is a long amount of time...is that really needed for 1 user to update something? If so I would re-think your logic, or maybe some of the queries could be incorporated into a CRON job and ran every x minutes to prevent he 10 second reload. You could also make note on the page to not click on anything until it is done processing.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.