{
- $this->availableServerIds();
+ $servers = $this->availableServers();
+ $ids = array();
+ foreach($servers as $s) {
+ $ids[] = $s->id;
+ }
if (empty($ids)) {
}
// called on current server.
- function availableServerIds()
+ function availableServers()
{
$ns = DB_DataObject::factory('core_notify_server');
$ns->poolname = $this->poolname;
$ns->is_active = 1;
$ns->orderBy('id ASC');
- return $ns->fetchAll('id' );
+ return $ns->fetchAll();
}
$ids = $this->availableServerIds();
+ $start = array_search($this->id, $ids);
+ $offset = $start+1;
+ while ($offset != )
$newid = $ids[ (array_search($this->id, $ids) +1) % count($ids) ];
// next server..