🐛 Trying to fix duplicate key when inserting
This commit is contained in:
parent
b398311bd2
commit
f392f12f76
@ -46,7 +46,8 @@ func adminTriggerScanTask(c *fiber.Ctx) error {
|
||||
return item.Hash
|
||||
})
|
||||
database.C.Clauses(clause.OnConflict{
|
||||
UpdateAll: true,
|
||||
Columns: []clause.Column{{Name: "hash"}},
|
||||
DoUpdates: clause.Assignments(map[string]interface{}{}),
|
||||
}).Create(&result)
|
||||
|
||||
log.Info().Str("source", src.ID).Int("count", len(result)).Msg("Scanned a news sources.")
|
||||
|
@ -48,7 +48,8 @@ func ScanNewsSources(eager ...bool) {
|
||||
return item.Hash
|
||||
})
|
||||
database.C.Clauses(clause.OnConflict{
|
||||
UpdateAll: true,
|
||||
Columns: []clause.Column{{Name: "hash"}},
|
||||
DoUpdates: clause.Assignments(map[string]interface{}{}),
|
||||
}).Create(&result)
|
||||
|
||||
log.Info().Str("source", src.ID).Int("count", len(result)).Msg("Scanned a news sources.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user