hotfix on qrz inserts
Some checks failed
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is failing

This commit is contained in:
Paul 2020-09-13 14:52:46 +02:00
parent bc6518b2a5
commit b873d89eba

View File

@ -50,7 +50,7 @@ func Run(config config.Config) (err error) {
if len(frsPeople) > 0 { if len(frsPeople) > 0 {
err = insertFrsEntryToDB(config, frsPeople) err = insertFrsEntryToDB(config, frsPeople)
if err != nil { if err != nil {
log.Fatalln(err) log.Println(err)
} }
} else { } else {
fmt.Println(fmt.Sprintf("No entry to insert in database for group %s", group)) fmt.Println(fmt.Sprintf("No entry to insert in database for group %s", group))
@ -147,8 +147,7 @@ func insertFrsEntryToDB(config config.Config, frsPeople map[string]Qrz) (err err
fmt.Println(fmt.Sprintf("Starting insert of %d entries", len(frsPeople))) fmt.Println(fmt.Sprintf("Starting insert of %d entries", len(frsPeople)))
for _, frs := range frsPeople { for _, frs := range frsPeople {
fmt.Println(frs) _, err = session.Insert(&frs)
session.Insert(&frs)
qrzNum++ qrzNum++
if (qrzNum % 5) == 0 { if (qrzNum % 5) == 0 {
err = session.Commit() err = session.Commit()