Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/258195
Change subject: Remove wfForeignMemcKey() usage from
JobQueueRedis::getQueueKey()
......................................................................
Remove wfForeignMemcKey() usage from JobQueueRedis::getQueueKey()
This class should manage the escaping it uses, rather than use some
random BagOStuff that has nothing to do with the job queue.
Change-Id: Ie716dc4a3429754a99c5f0670555e5e049b61aa1
---
M includes/jobqueue/JobQueueRedis.php
1 file changed, 9 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/95/258195/1
diff --git a/includes/jobqueue/JobQueueRedis.php
b/includes/jobqueue/JobQueueRedis.php
index 78d2a36..056174a 100644
--- a/includes/jobqueue/JobQueueRedis.php
+++ b/includes/jobqueue/JobQueueRedis.php
@@ -721,17 +721,22 @@
/**
* @param string $prop
- * @param string|null $type
+ * @param string|null $type Override this for sibling queues
* @return string
*/
private function getQueueKey( $prop, $type = null ) {
$type = is_string( $type ) ? $type : $this->type;
list( $db, $prefix ) = wfSplitWikiID( $this->wiki );
+ $keyspace = $prefix ? "$db-$prefix" : $db;
+
+ $parts = array( $keyspace, 'jobqueue', $type );
if ( strlen( $this->key ) ) { // namespaced queue (for testing)
- return wfForeignMemcKey( $db, $prefix, 'jobqueue',
$type, $this->key, $prop );
- } else {
- return wfForeignMemcKey( $db, $prefix, 'jobqueue',
$type, $prop );
+ $parts[] = $this->key;
}
+ $parts[] = $prop;
+
+ // Parts are typically ASCII, but encode for sanity to escape
":"
+ return implode( ':', array_map( 'rawurlencode', $parts ) );
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/258195
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie716dc4a3429754a99c5f0670555e5e049b61aa1
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