updte cron log format when output is empty or big

This commit is contained in:
aaronchen2k
2020-01-16 15:23:50 +08:00
parent fb7a45efe3
commit 341171bf1a
5 changed files with 18 additions and 22 deletions
+5 -15
View File
@@ -113,25 +113,15 @@ class gitModel extends model
$this->printLog("comment is\n----------\n" . trim($log->msg) . "\n----------");
$objects = $this->parseComment($log->msg);
if($objects)
{
$this->printLog('extract' .
' story:' . join(' ', $objects['stories']) .
' task:' . join(' ', $objects['tasks']) .
' bug:' . join(',', $objects['bugs']));
$this->saveAction2PMS($objects, $log);
}
else
{
$this->printLog('no objects found' . "\n");
if($objects) {
$this->printLog('extract ' . json_encode($objects));
}
}
$this->saveLastRevision($latestRevision);
$this->printLog("save revision $latestRevision");
$this->deleteRestartFile();
$this->printLog("\n\nrepo $name finished");
$this->printLog("\n\nrepo ' . $repo->id . ': ' . $repo->path . ' finished");
// check ci commands in logs
$pattern = $this->config->repo->commitCommands['entity'];
@@ -213,7 +203,7 @@ class gitModel extends model
foreach($repoObjs as $repoInDb)
{
if(strtolower($repoInDb->SCM) === 'git' && !in_array($repoInDb->path, $gitRepos)) {
$gitRepos[] = (object)array(id=>$repoInDb->id, path => $repoInDb->path, encoding => 'utf-8');
$gitRepos[] = (object)array('id'=>$repoInDb->id, 'path' => $repoInDb->path, 'encoding' => 'utf-8');
$paths[] = $repoInDb->path;
}
}
@@ -415,7 +405,7 @@ class gitModel extends model
$entityType = $matches[2];
$entityIds = $matches[3];
$ret[$entityType] = array(action=>$action, entities=> explode(",", $entityIds));
$ret[$entityType] = array('action'=>$action, 'entities'=> explode(",", $entityIds));
}
return $ret;