From 7101a3097f95ddb8d1d23c09585a7610fece1277 Mon Sep 17 00:00:00 2001 From: Andrew Brereton Date: Thu, 18 Dec 2014 17:27:18 +1100 Subject: [PATCH] gethostname() doesn't work on Amazon's EC2 --- lib/Resque/Worker.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/Resque/Worker.php b/lib/Resque/Worker.php index 379b853..d392b23 100644 --- a/lib/Resque/Worker.php +++ b/lib/Resque/Worker.php @@ -69,13 +69,8 @@ class Resque_Worker } $this->queues = $queues; - if(function_exists('gethostname')) { - $hostname = gethostname(); - } - else { - $hostname = php_uname('n'); - } - $this->hostname = $hostname; + $this->hostname = php_uname('n'); + $this->id = $this->hostname . ':'.getmypid() . ':' . implode(',', $this->queues); }