From cf6b71cd4dc35e64fa6c370c2531008fd469e243 Mon Sep 17 00:00:00 2001 From: David Ibarra Date: Wed, 16 Sep 2015 18:51:26 -0500 Subject: [PATCH] Fix issue with RAM consumption during expiry maintenance Currently, we SELECT * from the pastes table, when all we need is the pid and the expiry. This causes elevated RAM consumption by Stikked since it has to pull in paste bodies as well. Make the cron only pull in pid and expiry. --- htdocs/application/models/Pastes.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/application/models/Pastes.php b/htdocs/application/models/Pastes.php index 95bbd2c..35eee99 100644 --- a/htdocs/application/models/Pastes.php +++ b/htdocs/application/models/Pastes.php @@ -901,6 +901,7 @@ class Pastes extends CI_Model function cron() { $now = now(); + $this->db->select('pid,expire'); $this->db->where('toexpire', '1'); $query = $this->db->get('pastes'); foreach ($query->result_array() as $row)