Update changelog. Formatting fixes

This commit is contained in:
Chris Boulton 2010-08-01 15:03:28 +10:00
parent be2ffa7d6c
commit ae89f29057
2 changed files with 13 additions and 12 deletions

View File

@ -3,6 +3,8 @@
PHP. PHP.
* Implement ability to have setUp and tearDown methods for jobs, called before * Implement ability to have setUp and tearDown methods for jobs, called before
and after every single run. and after every single run.
* Ability to specify a cluster/multiple redis servers and consistent hash
between them (Thanks dceballos)
## 1.0 (2010-04-18) ## ## 1.0 (2010-04-18) ##

View File

@ -22,21 +22,20 @@ class Resque
* Given a host/port combination separated by a colon, set it as * Given a host/port combination separated by a colon, set it as
* the redis server that Resque will talk to. * the redis server that Resque will talk to.
* *
* @param string $server Host/port combination separated by a colon. * @param mixed $server Host/port combination separated by a colon, or
* a nested array of servers with host/port pairs.
*/ */
public static function setBackend($server) public static function setBackend($server)
{ {
if(is_array($server)) { if(is_array($server)) {
require_once dirname(__FILE__) . '/Resque/RedisCluster.php';
require_once dirname(__FILE__) . '/Resque/RedisCluster.php'; self::$redis = new Resque_RedisCluster($server);
self::$redis = new Resque_RedisCluster($server); }
else {
}else{ list($host, $port) = explode(':', $server);
list($host, $port) = explode(':', $server); require_once dirname(__FILE__) . '/Resque/Redis.php';
self::$redis = new Resque_Redis($host, $port);
require_once dirname(__FILE__) . '/Resque/Redis.php'; }
self::$redis = new Resque_Redis($host, $port);
}
} }
/** /**