From 408c098f144b94cdf5562eebbb3ba7c14246c679 Mon Sep 17 00:00:00 2001 From: joe <joe@autistici.org> Date: Sat, 16 Nov 2013 17:21:48 +0100 Subject: [PATCH] support flexihasher with more replicas (allowing for a more even distribution) --- r2db/db-hash.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r2db/db-hash.php b/r2db/db-hash.php index 6f69aaf00..8938929ed 100644 --- a/r2db/db-hash.php +++ b/r2db/db-hash.php @@ -1,8 +1,9 @@ <?php require_once(dirname(__FILE__) . '/flexihash.php'); +require_once( ABSPATH . 'wp-config.php' ); -$wpdb->hash_map = new Flexihash(); +$wpdb->hash_map = new Flexihash(null, R2DB_FLEXIHASH_REPLICAS); /* Hashing function to map blogs to databases. * @@ -16,4 +17,3 @@ function noblogs_db_callback($query, $wpdb) { } } $wpdb->add_callback('noblogs_db_callback'); - -- GitLab