Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/61739
Change subject: Added a --backoff option for syncFileBackend.php
......................................................................
Added a --backoff option for syncFileBackend.php
* This is useful for avoiding in-progress operations if locking
is not enabled (the journal is updated before file changes).
Change-Id: Ieab3b157a6858f68cc9259214cac1743b7525da0
---
M maintenance/syncFileBackend.php
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/39/61739/1
diff --git a/maintenance/syncFileBackend.php b/maintenance/syncFileBackend.php
index 158019b..e5d755e 100644
--- a/maintenance/syncFileBackend.php
+++ b/maintenance/syncFileBackend.php
@@ -40,6 +40,7 @@
$this->addOption( 'posdir', 'Directory to read/record journal
positions', false, true );
$this->addOption( 'posdump', 'Just dump current journal
position into the position dir.' );
$this->addOption( 'postime', 'For position dumps, get the ID at
this time', false, true );
+ $this->addOption( 'backoff', 'Stop at entries younger than this
age (sec).', false, true );
$this->addOption( 'verbose', 'Verbose mode', false, false, 'v'
);
$this->setBatchSize( 50 );
}
@@ -88,7 +89,13 @@
} else {
$startFromPosFile = false;
}
- $end = $this->getOption( 'end', INF );
+
+ if ( $this->hasOption( 'backoff' ) ) {
+ $time = time() - $this->getOption( 'backoff', 0 );
+ $end = (int)$src->getJournal()->getPositionAtTime(
$time );
+ } else {
+ $end = $this->getOption( 'end', INF );
+ }
$this->output( "Synchronizing backend '{$dst->getName()}' to
'{$src->getName()}'...\n" );
$this->output( "Starting journal position is $start.\n" );
--
To view, visit https://gerrit.wikimedia.org/r/61739
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieab3b157a6858f68cc9259214cac1743b7525da0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits