Hello all.
I am performing 50 calls to the server (same function with different parameters) for heavy duty database operation - generating Google sitemaps for almost one million documents (celebrity pages).
Each call requires about 8 seconds execution time.
I also wish to keep the business logic (script) in the MODx framework versus an independent PHP script file that is run from the command line or a cron job/windows scheduler.
The problem is that however I run the procedure from MODx, such as calling a snippet or running a module - the execution time is measure from when the client browser made the first call, and until the run is finished. That results in execution timeout errors.
I obviously close all open files and database requests at the end of each run of the function. I also tried to use different flush methods, sleep(), and what’s not. But the fact remains the same - the server monitors the execution as if it is a normal browser request and times it out after a few runs.
Is there a way to imitate a server-side command line call from within MODx? And also, is there some scheduling capabilities (not the existing event-driven plugin methods) to MODx that I am not aware of?
Many thanks.
Cheers,
Shlomo Tommer