* adjust for compile each tag.

This commit is contained in:
wangyidong
2020-03-09 09:13:24 +08:00
parent a694c8493f
commit aa07506688
2 changed files with 27 additions and 11 deletions
+13 -5
View File
@@ -148,14 +148,22 @@ class gitModel extends model
$jobs = zget($tagGroup, $repoID, array());
foreach($jobs as $job)
{
$tags = $this->getRepoTags($repo);
end($tags);
$lastTag = current($tags);
if($lastTag != $job->lastTag)
$tags = $this->getRepoTags($repo);
$isNew = false;
$lastTag = '';
foreach($tags as $tag)
{
if($tag == $job->lastTag)
{
$isNew = true;
continue;
}
if(!$isNew) continue;
$lastTag = $tag;
$this->compile->createByJob($job->id, $lastTag, 'tag');
$this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($job->id)->exec();
}
if($lastTag) $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($job->id)->exec();
}
}
}