cmd/ismdb: less noisy
This commit is contained in:
+2
-2
@@ -66,8 +66,8 @@ func insert(ctx context.Context, db *sqlitemigration.Pool, log *slog.Logger, car
|
|||||||
// if there's something wrong with the db.
|
// if there's something wrong with the db.
|
||||||
if err := insertCareer(conn, log, career, trainerID); err != nil {
|
if err := insertCareer(conn, log, career, trainerID); err != nil {
|
||||||
code := sqlite.ErrCode(err)
|
code := sqlite.ErrCode(err)
|
||||||
if code == sqlite.ResultConstraintUnique {
|
if code == sqlite.ResultConstraintPrimaryKey {
|
||||||
log.InfoContext(ctx, "already loaded")
|
log.DebugContext(ctx, "already loaded")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ func main() {
|
|||||||
ok := 0
|
ok := 0
|
||||||
for _, n := range fs {
|
for _, n := range fs {
|
||||||
log := log.With(slog.String("file", n))
|
log := log.With(slog.String("file", n))
|
||||||
log.Info("begin")
|
log.Debug("begin")
|
||||||
f, err := os.Open(n)
|
f, err := os.Open(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("open", slog.Any("err", err))
|
log.Error("open", slog.Any("err", err))
|
||||||
|
|||||||
Reference in New Issue
Block a user