hotfix on qrz inserts
This commit is contained in:
parent
bc6518b2a5
commit
b873d89eba
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user