avoid nil reference

This commit is contained in:
2021-07-29 20:45:45 +02:00
parent 959ac2d689
commit 31022f2384

10
main.go
View File

@@ -279,12 +279,16 @@ func (b *BuildManager) parseWorker() {
if !isLatest { if !isLatest {
if local != nil { if local != nil {
log.Infof("Delayed %s: not all dependencies are up to date (local: %s==%s, sync: %s==%s)", info.Pkgbase, local.Name(), local.Version(), local.Name(), syncVersion) log.Infof("Delayed %s: not all dependencies are up to date (local: %s==%s, sync: %s==%s)", info.Pkgbase, local.Name(), local.Version(), local.Name(), syncVersion)
dbLock.Lock()
dbPkg = dbPkg.Update().SetSkipReason(fmt.Sprintf("waiting for %s==%s", local.Name(), syncVersion)).SaveX(context.Background())
dbLock.Unlock()
} else { } else {
log.Infof("Delayed %s: not all dependencies are up to date", info.Pkgbase) log.Infof("Delayed %s: not all dependencies are up to date", info.Pkgbase)
dbLock.Lock()
dbPkg = dbPkg.Update().SetSkipReason("waiting for mirror").SaveX(context.Background())
dbLock.Unlock()
} }
dbLock.Lock()
dbPkg = dbPkg.Update().SetSkipReason(fmt.Sprintf("waiting for %s==%s", local.Name(), syncVersion)).SaveX(context.Background())
dbLock.Unlock()
b.parseWG.Done() b.parseWG.Done()
continue continue
} }