Jump to content

504 Gate Timeout on Long script


Jay D
 Share

Recommended Posts

Hi all, 

I am building a custom module for my project that processes some data from a separate db table into useable PW fields. I have a very basic module that extends Process. I think one of the issues is I need to start to return data to the screen, but using the

return $data

 method, the script will wait until everything is completed to show the progress, that's where I get the 504 Gateway Timeout. Is there any way to start to output to the screen using this method? 

Thank you in advance, 

Jay

Link to comment
Share on other sites

Hi Jay,

If you are expecting a lot of data to process, perhaps you might want to paginate your result to prevent long execution. You might also want to increase your PHP max_execution_time to 300 or more (up to you).

Link to comment
Share on other sites

Thanks for the tips Rudy! 

The pagination idea seems like the way to go. Do you know if there is a way to call a method by API, with no header/footer admin pages being returned? I could do some AJAX to print to screen as I loop through the data. 

Link to comment
Share on other sites

@Rudy are you able to provide any example on how you may paginate array to prevent long execution times? 

I have done imports before, but when the data get's too large it can take a while to load. How would you automate the pagination without also running into long execution times? 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...