Jump to content

best way to handle long-running scripts?


EvanAgee

Recommended Posts

So I've got a data import script that can potentially run very long as it handles downloading of images via URLs as well as importing large amounts of data (15,000+ lines) from Excel.

 

So what's the best way to make sure that the script actually runs to completion and doesn't time out? I've been using sleep() is that the best way?

Link to comment
https://forums.phpfreaks.com/topic/123544-best-way-to-handle-long-running-scripts/
Share on other sites

set_time_limit(0) may not be available to you if you are on shared hosting. Additionally, when you are using PHP to perform large tasks on a manual basis, you should always ignore_user_abort(true) to prevent a network problem from killing your script halfway through execution.

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.