Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mraron committed Aug 24, 2024
1 parent 5dff377 commit 645ab56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cmd/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package cmd

import (
"fmt"
"log/slog"

_ "github.com/golang-migrate/migrate/v4/source/file"
_ "github.com/lib/pq"
"github.com/mraron/njudge/internal/njudge/db/migrations"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"log/slog"
)

type MigrateCmdArgs struct {
Expand Down Expand Up @@ -35,7 +36,9 @@ func NewMigrateCommand(v *viper.Viper) *cobra.Command {
}

m, err := migrations.NewMigrate(db, true)

if err != nil {
return err
}
if migrateArgs.Up {
err = m.Up()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/web/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (s *Server) pruneUnactivatedUsers(ctx context.Context) {
for {
lst, err := s.Users.GetAll(ctx)
if err != nil {
s.Logger.ErrorContext(ctx, "error pruning unactivated users", err)
s.Logger.ErrorContext(ctx, "error pruning unactivated users", "error", err)
}
cnt := 0
for ind := range lst {
Expand All @@ -36,7 +36,7 @@ func (s *Server) pruneUnactivatedUsers(ctx context.Context) {
}
}
if err != nil {
s.Logger.ErrorContext(ctx, "error occured while pruning", err)
s.Logger.ErrorContext(ctx, "error occured while pruning", "error", err)
}else {
s.Logger.InfoContext(ctx, fmt.Sprintf("pruned %d inactive, unactivated accounts", cnt))
}
Expand Down

0 comments on commit 645ab56

Please sign in to comment.