Skip to content

Commit 2bae059

Browse files
committed
fix setUserAndGroup bug
1 parent 8eb725c commit 2bae059

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

example/http_daemon.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@
2727
'time' => '* * * * *',
2828
],
2929
];
30+
3031
$logger = new \Monolog\Logger(\Jenner\Crontab\Crontab::NAME);
3132
$logger->pushHandler(new \Monolog\Handler\StreamHandler("/var/log/php_crontab.log"));
33+
try{
34+
$http_daemon = new \Jenner\Crontab\HttpDaemon($missions, $logger);
35+
$http_daemon->start();
36+
}catch(Exception $e) {
3237

33-
$http_daemon = new \Jenner\Crontab\HttpDaemon($missions, $logger);
34-
$http_daemon->start();
38+
}

src/Jenner/Crontab/Mission.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ public function info()
237237
*/
238238
public function run()
239239
{
240+
$this->setUserAndGroup();
241+
240242
$out = $this->out;
241243
$err = $this->err;
242244
$process = new \Symfony\Component\Process\Process($this->cmd);

0 commit comments

Comments
 (0)