Welcome Guest, Not a member yet? Register   Sign In
Post_system hook and ob_flush()
#1

[eluser]mscahill[/eluser]
I'm attempting to use a post_system hook in order to launch off some maintenance functions (ie. optimize and backup tables, send e-mail notifications, etc). Unfortunately, I can't get ob_flush() to work with the post_system hook. I get no output from the buffer until the last maintenance function completes. I do have safeguards in place to ensure that only one copy of the maintenance functions are run per day. It just sucks for the poor bugger that logs in first, because they have to stare at a blank screen for close to 5 minutes. Of course, it they just hit refresh, it clears the buffer, and the maintenance functions continue to run in the background. Then they can continue to use the system as normal.

Any ideas on how to get the buffer to flush properly from a post_system hook?
#2

[eluser]mscahill[/eluser]
I changed the hook to a display_override hook, and I am now manually outputting the buffer. It works as expected. The page shows up immediately, but the page shows as still loading while the maintenance functions run. I still don't know why this wouldn't work as a post_system hook, but my problem is solved. Hopefully this will help if someone else runs into this problem.




Theme © iAndrew 2016 - Forum software by © MyBB