ListController: be more careful on cleanup

Still incomplete
This commit is contained in:
Thomas Gelf 2015-10-16 23:01:56 +02:00
parent 87f26f182d
commit ce973a20c1

View File

@ -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()