? drupal7.kpf
? ignore_slave_3.patch
? ignore_slave_4.patch
? nbproject
? sites/all/modules/admin_menu
? sites/all/modules/project_issue_file_review
? sites/default/files
? sites/default/settings.php
Index: includes/database/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/database.inc,v
retrieving revision 1.59
diff -u -p -r1.59 database.inc
--- includes/database/database.inc	3 Jul 2009 10:57:46 -0000	1.59
+++ includes/database/database.inc	6 Jul 2009 16:09:23 -0000
@@ -2431,6 +2431,24 @@ function _db_error_page($error = '') {
   drupal_set_title('Site offline');
 }
 
+ /**
+ * Helper function to get duration lag from variable
+ * and set the session variable that contains the lag.
+ */
+function db_ignore_slave() {
+  $connection_info = Database::getConnectionInfo();
+  // Only set ignore_slave_server if there are slave servers
+  // being used, which is assumed if there are more than one.    
+  if (count($connection_info) > 1) {
+    // Five minutes is long enough to allow the slave to break and resume
+    // interrupted replication without causing problems on the Drupal site
+    // from the old data.
+    $duration = variable_get('maximum_replication_lag', 300);
+    // Set session variable with amount of time to delay before using slave.
+    $_SESSION['ignore_slave_server'] = REQUEST_TIME + $duration;
+  }
+}
+
 /**
  * @ingroup database-legacy
  *
@@ -2645,19 +2663,5 @@ function db_rewrite_sql($query, $primary
 }
 
 /**
- * Helper function to get duration lag from variable
- * and set the session variable that contains the lag.
- */
-function db_ignore_slave() {
-  // Five minutes is long enough to allow the slave to break and resume
-  // interrupted replication without causing problems on the Drupal site
-  // from the old data.
-  $duration = variable_get('maximum_replication_lag', 300);
-  
-  // Set session variable with amount of time to delay  before using slave.
-  $_SESSION['ignore_slave_server'] = REQUEST_TIME + $duration;
-}
-
-/**
  * @} End of "ingroup database-legacy".
  */
