mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
ListController: be more careful on cleanup
Still incomplete
This commit is contained in:
parent
87f26f182d
commit
ce973a20c1
@ -149,6 +149,7 @@ class Director_ListController extends ActionController
|
|||||||
protected function fetchLogs()
|
protected function fetchLogs()
|
||||||
{
|
{
|
||||||
$api = $this->api();
|
$api = $this->api();
|
||||||
|
$collected = false;
|
||||||
foreach ($this->db()->getUncollectedDeployments() as $deployment) {
|
foreach ($this->db()->getUncollectedDeployments() as $deployment) {
|
||||||
$stage = $deployment->stage_name;
|
$stage = $deployment->stage_name;
|
||||||
try {
|
try {
|
||||||
@ -170,12 +171,15 @@ class Director_ListController extends ActionController
|
|||||||
}
|
}
|
||||||
$deployment->startup_log = $this->api()->getStagedFile($stage, 'startup.log');
|
$deployment->startup_log = $this->api()->getStagedFile($stage, 'startup.log');
|
||||||
}
|
}
|
||||||
|
$collected = true;
|
||||||
|
|
||||||
$deployment->store();
|
$deployment->store();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not correct, we might clear logs we formerly skipped
|
// Not correct, we might clear logs we formerly skipped
|
||||||
$api->wipeInactiveStages();
|
if ($collected) {
|
||||||
|
$api->wipeInactiveStages();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function api()
|
protected function api()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user