Skip to content

Commit 7101a30

Browse files
gethostname() doesn't work on Amazon's EC2
1 parent c335bc3 commit 7101a30

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
@@ -69,13 +69,8 @@ public function __construct($queues)
6969
}
7070

7171
$this->queues = $queues;
72-
if(function_exists('gethostname')) {
73-
$hostname = gethostname();
74-
}
75-
else {
76-
$hostname = php_uname('n');
77-
}
78-
$this->hostname = $hostname;
72+
$this->hostname = php_uname('n');
73+
7974
$this->id = $this->hostname . ':'.getmypid() . ':' . implode(',', $this->queues);
8075
}
8176

0 commit comments

Comments
 (0)