🐛 fix get error account

pull/548/head
微凉 2021-11-15 14:53:32 +08:00
parent caddba05e9
commit aeb72320ca
1 changed files with 2 additions and 2 deletions

View File

@ -89,13 +89,13 @@ func initAccounts() {
if err := conf.DB.Find(&accounts).Error; err != nil {
log.Fatalf("failed sync init accounts")
}
for _, account := range accounts {
for i, account := range accounts {
model.RegisterAccount(account)
driver, ok := drivers.GetDriver(account.Type)
if !ok {
log.Errorf("no [%s] driver", driver)
} else {
err := driver.Save(&account, nil)
err := driver.Save(&accounts[i], nil)
if err != nil {
log.Errorf("init account [%s] error:[%s]", account.Name, err.Error())
}