Skip to content

Commit 333e545

Browse files
Arkadiy Kukarkindanhunsaker
authored andcommitted
Fix {/( block syntax error
1 parent bf50326 commit 333e545

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

bin/resque

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ if($count > 1) {
130130

131131
$PIDFILE = getenv('PIDFILE');
132132
if ($PIDFILE) {
133-
file_put_contents($PIDFILE, getmypid()) or
134-
die('Could not write PID information to ' . $PIDFILE);
133+
file_put_contents($PIDFILE, getmypid()) or (
134+
$logger->log(Psr\Log\LogLevel::NOTICE, 'Could not write PID information to {pidfile}', array('pidfile' => $PIDFILE)) and
135+
die(2)
136+
);
135137
}
136138

137139
$registered = TRUE;
@@ -171,11 +173,13 @@ else {
171173
$worker->logLevel = $logLevel;
172174
$worker->hasParent = FALSE;
173175

174-
$PIDFILE = getenv('PIDFILE');
175-
if ($PIDFILE) {
176-
file_put_contents($PIDFILE, getmypid()) or
177-
die('Could not write PID information to ' . $PIDFILE);
178-
}
176+
$PIDFILE = getenv('PIDFILE');
177+
if ($PIDFILE) {
178+
file_put_contents($PIDFILE, getmypid()) or (
179+
$logger->log(Psr\Log\LogLevel::NOTICE, 'Could not write PID information to {pidfile}', array('pidfile' => $PIDFILE)) and
180+
die(2)
181+
);
182+
}
179183

180184
$logger->log(Psr\Log\LogLevel::NOTICE, 'Starting worker {worker}', array('worker' => $worker));
181185
$worker->work($interval, $BLOCKING);

0 commit comments

Comments
 (0)