gethostname() doesn't work on Amazon's EC2

This commit is contained in:
Andrew Brereton 2014-12-18 17:27:18 +11:00
parent c335bc3555
commit 7101a3097f

View File

@ -69,13 +69,8 @@ class Resque_Worker
} }
$this->queues = $queues; $this->queues = $queues;
if(function_exists('gethostname')) { $this->hostname = php_uname('n');
$hostname = gethostname();
}
else {
$hostname = php_uname('n');
}
$this->hostname = $hostname;
$this->id = $this->hostname . ':'.getmypid() . ':' . implode(',', $this->queues); $this->id = $this->hostname . ':'.getmypid() . ':' . implode(',', $this->queues);
} }