troywilliams/moodle-mod_dialogue — pull request #14 by danmarsden (2012-06-08 11:14:28+00:00)
Title: cron perf improvements

Hi Troy - here's an initial group of patches to improve performance of the cron tasks - would be great if you were able to take a look and peer-review the code as I don't have many dialogues set up in my test install and I'm not as experienced with dialogue as you will be

there's a block of code there that I've added comments around that I couldn't quite understand - it seems to be calling get_users_by_cap a second time for the same context - get_users_by_cap is a pretty heavy function call so it would be good if we can figure out if it's needed or restructure it a bit further to avoid if poss - let me know if you are able to explain why it's still needed.

I've also split out part of the code in the cron so it doesn't run every time cron is called as I didn't think that it needed to be run every 60sec - if you think that will cause issues let me know!

thanks