Ripping mobility from the clutches of telecom
Long Running Background Scripts with CodeIgniter
I’ve been working on a project using CodeIgniter recently, and have been trying to clean some stuff up so that long running background scripts use the same code as the live system. Sane, every framework has some way of wiring it up so you can run command line tasks using the same framework as you’re running for web requests, and CodeIgniter is no exception. For some reason stuff that used to run find as bare mysql scripts kept running out of memory when I ran it within CI. Turns out the DB wrapper actually stores all the queries it runs in a big array. Not an issue when processing web requests I’m sure, but definitely an issue when you’re running big background tasks. If you want to keep your scripts from running out of memory it’s easy enough to do:
$this->db->save_queries = false;
| Print article | This entry was posted by miker on November 3, 2009 at 5:43 pm, and is filed under Open Source, Software. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
