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 "kafka: Implement ack handling"
[lhc/web/wiklou.git]
/
includes
/
deferred
/
CdnCacheUpdate.php
diff --git
a/includes/deferred/CdnCacheUpdate.php
b/includes/deferred/CdnCacheUpdate.php
index
32f6adc
..
4ce9e62
100644
(file)
--- a/
includes/deferred/CdnCacheUpdate.php
+++ b/
includes/deferred/CdnCacheUpdate.php
@@
-22,6
+22,7
@@
*/
use Wikimedia\Assert\Assert;
*/
use Wikimedia\Assert\Assert;
+use MediaWiki\MediaWikiServices;
/**
* Handles purging appropriate CDN URLs given a title (or titles)
/**
* Handles purging appropriate CDN URLs given a title (or titles)
@@
-109,13
+110,20
@@
class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate {
wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) );
// Reliably broadcast the purge to all edge nodes
wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) );
// Reliably broadcast the purge to all edge nodes
- $relayer = EventRelayerGroup::singleton()->getRelayer( 'cdn-url-purges' );
- $relayer->notify(
+ $relayer = MediaWikiServices::getInstance()->getEventRelayerGroup()
+ ->getRelayer( 'cdn-url-purges' );
+ $ts = microtime( true );
+ $relayer->notifyMulti(
'cdn-url-purges',
'cdn-url-purges',
- [
- 'urls' => array_values( $urlArr ), // JSON array
- 'timestamp' => microtime( true )
- ]
+ array_map(
+ function ( $url ) use ( $ts ) {
+ return [
+ 'url' => $url,
+ 'timestamp' => $ts,
+ ];
+ },
+ $urlArr
+ )
);
// Send lossy UDP broadcasting if enabled
);
// Send lossy UDP broadcasting if enabled