mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
JobRunner: unify log messages
This commit is contained in:
parent
aef10a5f80
commit
79243f660a
@ -172,7 +172,7 @@ class JobRunner implements DbBasedComponent
|
|||||||
{
|
{
|
||||||
$id = $job->get('id');
|
$id = $job->get('id');
|
||||||
$jobName = $job->get('job_name');
|
$jobName = $job->get('job_name');
|
||||||
Logger::debug("Job starting: $jobName");
|
Logger::debug("Job ($jobName) starting");
|
||||||
$arguments = [
|
$arguments = [
|
||||||
'director',
|
'director',
|
||||||
'job',
|
'job',
|
||||||
@ -199,11 +199,11 @@ class JobRunner implements DbBasedComponent
|
|||||||
}
|
}
|
||||||
unset($this->scheduledIds[$id]);
|
unset($this->scheduledIds[$id]);
|
||||||
$this->runningIds[$id] = $cli->run($this->loop)->then(function () use ($id, $jobName) {
|
$this->runningIds[$id] = $cli->run($this->loop)->then(function () use ($id, $jobName) {
|
||||||
Logger::debug("Job finished: $jobName");
|
Logger::debug("Job ($jobName) finished");
|
||||||
})->otherwise(function (\Exception $e) use ($id, $jobName) {
|
})->otherwise(function (\Exception $e) use ($id, $jobName) {
|
||||||
Logger::error('Job failed: ' . $e->getMessage());
|
Logger::error("Job ($jobName) failed: " . $e->getMessage());
|
||||||
})->otherwise(function (FinishedProcessState $state) {
|
})->otherwise(function (FinishedProcessState $state) use ($jobName) {
|
||||||
Logger::error($state->getReason());
|
Logger::error("Job ($jobName) failed: " . $state->getReason());
|
||||||
})->always(function () use ($id) {
|
})->always(function () use ($id) {
|
||||||
unset($this->runningIds[$id]);
|
unset($this->runningIds[$id]);
|
||||||
$this->loop->futureTick(function () {
|
$this->loop->futureTick(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user