From: Aaron Schulz Date: Thu, 10 Dec 2015 19:29:31 +0000 (-0800) Subject: Remove wfForeignMemcKey() usage from JobQueueRedis::getQueueKey() X-Git-Tag: 1.31.0-rc.0~8733 X-Git-Url: http://git.cyclocoop.org/data/%24%7Bnav_urls/projects/%28?a=commitdiff_plain;h=d54591216efd17238fa8df7f6d85f4195b89d683;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/jobqueue/JobQueueRedis.php b/includes/jobqueue/JobQueueRedis.php index 3e7bdcc588..67420f0957 100644 --- a/includes/jobqueue/JobQueueRedis.php +++ b/includes/jobqueue/JobQueueRedis.php @@ -797,13 +797,17 @@ LUA; /** * @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; - return wfForeignMemcKey( $db, $prefix, 'jobqueue', $type, $prop ); + $parts = array( $keyspace, 'jobqueue', $type, $prop ); + + // Parts are typically ASCII, but encode for sanity to escape ":" + return implode( ':', array_map( 'rawurlencode', $parts ) ); } }