dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Change the rfcurl from protocol relative to HTTPS"
[lhc/web/wiklou.git]
/
maintenance
/
updateRestrictions.php
diff --git
a/maintenance/updateRestrictions.php
b/maintenance/updateRestrictions.php
index
96eaf82
..
334ed27
100644
(file)
--- a/
maintenance/updateRestrictions.php
+++ b/
maintenance/updateRestrictions.php
@@
-36,11
+36,12
@@
class UpdateRestrictions extends Maintenance {
public function __construct() {
parent::__construct();
$this->addDescription( 'Updates page_restrictions table from old page_restriction column' );
public function __construct() {
parent::__construct();
$this->addDescription( 'Updates page_restrictions table from old page_restriction column' );
- $this->setBatchSize( 100 );
+ $this->setBatchSize( 100
0
);
}
public function execute() {
$db = $this->getDB( DB_MASTER );
}
public function execute() {
$db = $this->getDB( DB_MASTER );
+ $batchSize = $this->getBatchSize();
if ( !$db->tableExists( 'page_restrictions' ) ) {
$this->error( "page_restrictions table does not exist", true );
}
if ( !$db->tableExists( 'page_restrictions' ) ) {
$this->error( "page_restrictions table does not exist", true );
}
@@
-52,12
+53,12
@@
class UpdateRestrictions extends Maintenance {
$end = $db->selectField( 'page', 'MAX(page_id)', false, __METHOD__ );
# Do remaining chunk
$end = $db->selectField( 'page', 'MAX(page_id)', false, __METHOD__ );
# Do remaining chunk
- $end += $
this->mB
atchSize - 1;
+ $end += $
b
atchSize - 1;
$blockStart = $start;
$blockStart = $start;
- $blockEnd = $start + $
this->mB
atchSize - 1;
+ $blockEnd = $start + $
b
atchSize - 1;
$encodedExpiry = 'infinity';
while ( $blockEnd <= $end ) {
$encodedExpiry = 'infinity';
while ( $blockEnd <= $end ) {
- $this->output( "...doing page_id from $blockStart to $blockEnd\n" );
+ $this->output( "...doing page_id from $blockStart to $blockEnd
out of $end
\n" );
$cond = "page_id BETWEEN $blockStart AND $blockEnd AND page_restrictions !=''";
$res = $db->select(
'page',
$cond = "page_id BETWEEN $blockStart AND $blockEnd AND page_restrictions !=''";
$res = $db->select(
'page',
@@
-105,8
+106,8
@@
class UpdateRestrictions extends Maintenance {
throw new MWException( "Deadlock loop failed wtf :(" );
}
}
throw new MWException( "Deadlock loop failed wtf :(" );
}
}
- $blockStart += $
this->mB
atchSize - 1;
- $blockEnd += $
this->mB
atchSize - 1;
+ $blockStart += $
b
atchSize - 1;
+ $blockEnd += $
b
atchSize - 1;
wfWaitForSlaves();
}
$this->output( "...removing dead rows from page_restrictions\n" );
wfWaitForSlaves();
}
$this->output( "...removing dead rows from page_restrictions\n" );