Jay D Posted June 1, 2021 Share Posted June 1, 2021 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 More sharing options...
Rudy Posted June 1, 2021 Share Posted June 1, 2021 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 More sharing options...
Jay D Posted June 1, 2021 Author Share Posted June 1, 2021 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 More sharing options...
Rudy Posted June 1, 2021 Share Posted June 1, 2021 Since you're working on a PW environment, you should probably use PW's WireArray and Paginated Array API. 1 Link to comment Share on other sites More sharing options...
Tom. Posted June 2, 2021 Share Posted June 2, 2021 @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? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now