From 064468a28a064305e700069126b38c3b25cad408 Mon Sep 17 00:00:00 2001 From: Stephen Shkardoon Date: Wed, 22 Oct 2014 19:01:34 +1300 Subject: [PATCH] Add a no-op query to prevent database timeouts during a long reindex --- code/solr/Solr.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/solr/Solr.php b/code/solr/Solr.php index 92f28bc..a88444d 100644 --- a/code/solr/Solr.php +++ b/code/solr/Solr.php @@ -270,6 +270,9 @@ class Solr_Reindex extends BuildTask { // If we're in dev mode, commit more often for fun and profit if (Director::isDev()) Solr::service($index)->commit(); + + // This will slow down things a tiny bit, but it is done so that we don't timeout to the database during a reindex + DB::query('SELECT 1'); } } }