Index: branches/wmf/1.17wmf1/includes/ExternalStoreDB.php |
— | — | @@ -29,8 +29,18 @@ |
30 | 30 | * @return DatabaseBase object |
31 | 31 | */ |
32 | 32 | function &getSlave( $cluster ) { |
| 33 | + global $wgDefaultExternalStore; |
| 34 | + |
33 | 35 | $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false; |
34 | 36 | $lb =& $this->getLoadBalancer( $cluster ); |
| 37 | + |
| 38 | + if ( !in_array( "DB://".$cluster, $wgDefaultExternalStore ) ) { |
| 39 | + wfDebug( "read only external store" ); |
| 40 | + $lb->allowLagged(true); |
| 41 | + } else { |
| 42 | + wfDebug( "writable external store" ); |
| 43 | + } |
| 44 | + |
35 | 45 | return $lb->getConnection( DB_SLAVE, array(), $wiki ); |
36 | 46 | } |
37 | 47 | |