Skip to content

Commit

Permalink
Consume ThingConnect in bootstrap
Browse files Browse the repository at this point in the history
Signed-off-by: JeffMboya <[email protected]>
  • Loading branch information
JeffMboya committed Apr 30, 2024
1 parent 8595983 commit 0b87686
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bootstrap/postgres/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ func (cr configRepository) Save(ctx context.Context, cfg bootstrap.Config, chsCo
dbcfg := toDBConfig(cfg)

if _, err := tx.NamedExec(q, dbcfg); err != nil {
e := err
if pgErr, ok := err.(*pgconn.PgError); ok && pgErr.Code == pgerrcode.UniqueViolation {
e = repoerr.ErrConflict
err = repoerr.ErrConflict
}

if errRollback := cr.rollback("failed to insert a Config", tx); errRollback != nil {
return "", errors.Wrap(err, errRollback)
}
return "", errors.Wrap(repoerr.ErrCreateEntity, e)
}

if err := insertChannels(ctx, cfg.Owner, cfg.Channels, tx); err != nil {
Expand Down

0 comments on commit 0b87686

Please sign in to comment.