Skip to content

Commit 3cead7d

Browse files
authored
Merge pull request chrisboulton#226 from andrewbrereton/patch-1
gethostname() doesn't work on Amazon's EC2
2 parents 5de9073 + 7101a30 commit 3cead7d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/Resque/Worker.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,8 @@ public function __construct($queues)
7171
}
7272

7373
$this->queues = $queues;
74-
if(function_exists('gethostname')) {
75-
$hostname = gethostname();
76-
}
77-
else {
78-
$hostname = php_uname('n');
79-
}
80-
$this->hostname = $hostname;
74+
$this->hostname = php_uname('n');
75+
8176
$this->id = $this->hostname . ':'.getmypid() . ':' . implode(',', $this->queues);
8277
}
8378

0 commit comments

Comments
 (0)