config/deployments: collect uncollected stages...
...if any when refreshing the history refs #11979
This commit is contained in:
parent
4d34a8ade1
commit
29231ef8c8
|
@ -19,7 +19,9 @@ class ConfigController extends ActionController
|
|||
{
|
||||
$this->setAutorefreshInterval(5);
|
||||
try {
|
||||
if ($this->getRequest()->getUrl()->shift('checkforchanges')) {
|
||||
if ($this->db()->hasUncollectedDeployments()
|
||||
|| $this->getRequest()->getUrl()->shift('checkforchanges')
|
||||
) {
|
||||
$this->api()->collectLogFiles($this->db());
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
|
|
@ -689,4 +689,16 @@ class Db extends DbConnection
|
|||
|
||||
return DirectorDeploymentLog::loadAll($this, $query, 'stage_name');
|
||||
}
|
||||
|
||||
public function hasUncollectedDeployments()
|
||||
{
|
||||
$db = $this->db();
|
||||
$query = $db->select()
|
||||
->from('director_deployment_log', array('cnt' => 'COUNT(*)'))
|
||||
->where('stage_name IS NOT NULL')
|
||||
->where('stage_collected IS NULL')
|
||||
->where('startup_succeeded IS NULL');
|
||||
|
||||
return $db->fetchOne($query) > 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue