Skip to content

Commit

Permalink
Storage import - fix for sql error on deleting storages
Browse files Browse the repository at this point in the history
  • Loading branch information
edoshor committed Feb 8, 2018
1 parent f09c8c9 commit 2281025
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/rest.go
Expand Up @@ -4202,7 +4202,7 @@ func allowedSecureLevel(cp utils.ContextProvider) int16 {

// internal network (hopefully MDB-CIT [aka rename])
if strings.HasPrefix(clientIP, "10.") {
log.Info("Internal network secure level: %s", clientIP)
log.Infof("Internal network secure level: %s", clientIP)
return SEC_PRIVATE
}
}
Expand Down
4 changes: 1 addition & 3 deletions storage/import.go
Expand Up @@ -268,9 +268,7 @@ func syncStorages(db *sql.DB) error {
tx, err = db.Begin()
utils.Must(err)

// TODO: this is buggy, seems like a bug in sqlboiler...
// need to dig in and fix asap
err = models.Storages(tx, qm.WhereIn("id in ?", ids)).DeleteAll()
err = models.Storages(tx, qm.WhereIn("id in ?", utils.ConvertArgsInt64(ids)...)).DeleteAll()
if err != nil {
utils.Must(tx.Rollback())
return errors.Wrap(err, "Delete storages from MDB")
Expand Down

0 comments on commit 2281025

Please sign in to comment.