summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-07-01 08:11:27 +0000
committerDries Buytaert <dries@buytaert.net>2009-07-01 08:11:27 +0000
commit8eb8dcc8425295d1a4278613031812bff7d98c15 (patch)
tree665ff11ef19c4d8f9ea643effb7df5dab552db41 /includes
parent9ce7b3dcdc2cc964f422594b1cc65440cd7decef (diff)
downloadbrdo-8eb8dcc8425295d1a4278613031812bff7d98c15.tar.gz
brdo-8eb8dcc8425295d1a4278613031812bff7d98c15.tar.bz2
- Patch #314358 by wonder95, Crell, killes, et al: add option to ignore slave servers. Finally.
Diffstat (limited to 'includes')
-rw-r--r--includes/database/database.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index 44a90c1ee..45f4d748c 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -2687,6 +2687,19 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $
return $query;
}
+/**
+ * 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".