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 "Improvements to RefreshLinksJob/DeleteLinksJob locking"
[lhc/web/wiklou.git]
/
includes
/
deferred
/
DataUpdate.php
diff --git
a/includes/deferred/DataUpdate.php
b/includes/deferred/DataUpdate.php
index
9cbb62f
..
2865461
100644
(file)
--- a/
includes/deferred/DataUpdate.php
+++ b/
includes/deferred/DataUpdate.php
@@
-31,7
+31,7
@@
*/
abstract class DataUpdate implements DeferrableUpdate {
public function __construct() {
*/
abstract class DataUpdate implements DeferrableUpdate {
public function __construct() {
- //noop
+ //
noop
}
/**
}
/**
@@
-39,7
+39,7
@@
abstract class DataUpdate implements DeferrableUpdate {
* This default implementation does nothing.
*/
public function beginTransaction() {
* This default implementation does nothing.
*/
public function beginTransaction() {
- //noop
+ //
noop
}
/**
}
/**
@@
-47,7
+47,7
@@
abstract class DataUpdate implements DeferrableUpdate {
* This default implementation does nothing.
*/
public function commitTransaction() {
* This default implementation does nothing.
*/
public function commitTransaction() {
- //noop
+ //
noop
}
/**
}
/**
@@
-55,7
+55,7
@@
abstract class DataUpdate implements DeferrableUpdate {
* This default implementation does nothing.
*/
public function rollbackTransaction() {
* This default implementation does nothing.
*/
public function rollbackTransaction() {
- //noop
+ //
noop
}
/**
}
/**
@@
-84,7
+84,7
@@
abstract class DataUpdate implements DeferrableUpdate {
return; // nothing to do
}
return; // nothing to do
}
- $open_transactions =
array()
;
+ $open_transactions =
[]
;
$exception = null;
try {
$exception = null;
try {
@@
-127,14
+127,15
@@
abstract class DataUpdate implements DeferrableUpdate {
*
* @param DataUpdate[] $updates A list of DataUpdate instances
* @return DataUpdate[]
*
* @param DataUpdate[] $updates A list of DataUpdate instances
* @return DataUpdate[]
- * @since 1.2
6
+ * @since 1.2
7
*/
protected static function enqueueUpdates( array $updates ) {
*/
protected static function enqueueUpdates( array $updates ) {
- $remaining =
array()
;
+ $remaining =
[]
;
foreach ( $updates as $update ) {
if ( $update instanceof EnqueueableDataUpdate ) {
foreach ( $updates as $update ) {
if ( $update instanceof EnqueueableDataUpdate ) {
- $update->enqueueUpdate();
+ $spec = $update->getAsJobSpecification();
+ JobQueueGroup::singleton( $spec['wiki'] )->push( $spec['job'] );
} else {
$remaining[] = $update;
}
} else {
$remaining[] = $update;
}
@@
-145,12
+146,16
@@
abstract class DataUpdate implements DeferrableUpdate {
}
/**
}
/**
- * @since 1.26
+ * Interface that marks a DataUpdate as enqueuable via the JobQueue
+ *
+ * Such updates must be representable using IJobSpecification, so that
+ * they can be serialized into jobs and enqueued for later execution
+ *
+ * @since 1.27
*/
interface EnqueueableDataUpdate {
/**
*/
interface EnqueueableDataUpdate {
/**
- *
Push the update into the job queue
+ *
@return array (wiki => wiki ID, job => IJobSpecification)
*/
*/
- public function
enqueueUpdate
();
+ public function
getAsJobSpecification
();
}
}
-