Merge pull request #860 from ScorpioCPH/minor-fix-log-print

minor fix log print
This commit is contained in:
Daniel Jiang 2016-10-10 10:59:22 +08:00 committed by GitHub
commit e9a3bb989c

View File

@ -288,20 +288,22 @@ func SyncRegistry() error {
repoRecord := models.RepoRecord{Name: repoToAdd, OwnerName: user, ProjectName: project, PullCount: pullCount} repoRecord := models.RepoRecord{Name: repoToAdd, OwnerName: user, ProjectName: project, PullCount: pullCount}
if err := dao.AddRepository(repoRecord); err != nil { if err := dao.AddRepository(repoRecord); err != nil {
log.Errorf("Error happens when adding the missing repository: %v", err) log.Errorf("Error happens when adding the missing repository: %v", err)
} } else {
log.Debugf("Add repository: %s success.", repoToAdd) log.Debugf("Add repository: %s success.", repoToAdd)
} }
} }
}
if len(reposToDel) > 0 { if len(reposToDel) > 0 {
log.Debugf("Start deleting repositories from DB... ") log.Debugf("Start deleting repositories from DB... ")
for _, repoToDel := range reposToDel { for _, repoToDel := range reposToDel {
if err := dao.DeleteRepository(repoToDel); err != nil { if err := dao.DeleteRepository(repoToDel); err != nil {
log.Errorf("Error happens when deleting the repository: %v", err) log.Errorf("Error happens when deleting the repository: %v", err)
} } else {
log.Debugf("Delete repository: %s success.", repoToDel) log.Debugf("Delete repository: %s success.", repoToDel)
} }
} }
}
log.Debugf("Sync repositories from registry to DB is done.") log.Debugf("Sync repositories from registry to DB is done.")
return nil return nil