Skip to content

Commit

Permalink
Merge pull request #42 from satisfactorymodding/staging
Browse files Browse the repository at this point in the history
fix: no mod views?
  • Loading branch information
Vilsol authored Jan 6, 2024
2 parents c1eba24 + ca55300 commit 0eef1d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion db/postgres/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ func GetModCountNew(ctx context.Context, filter *models.ModFilter, unapproved bo
}

func IncrementModViews(ctx context.Context, mod *Mod) {
DBCtx(ctx).Model(mod).Update("views", mod.Views+1)
// TODO unignore
//DBCtx(ctx).Model(mod).Update("views", mod.Views+1)

Check failure on line 124 in db/postgres/mod.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)

Check failure on line 124 in db/postgres/mod.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)
}

func GetMods(ctx context.Context, limit int, offset int, orderBy string, order string, search string, unapproved bool) []Mod {
Expand Down
6 changes: 3 additions & 3 deletions gql/gql_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ func WrapMutationTrace(ctx context.Context, action string) (TraceWrapper, contex
}

func wrapTrace(ctx context.Context, action string, actionType string) (TraceWrapper, context.Context) {
//spanCtx, span := otel.Tracer("gql").Start(ctx, "GraphQL "+action, trace.WithAttributes(
// spanCtx, span := otel.Tracer("gql").Start(ctx, "GraphQL "+action, trace.WithAttributes(
// attribute.String("action_type", "API.graphql."+actionType),
//))

Check failure on line 32 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)

Check failure on line 32 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)

return TraceWrapper{
//Span: span,
// Span: span,
}, ctx
}

func (wrapper TraceWrapper) end() {
//defer wrapper.Span.End()
// defer wrapper.Span.End()
//
//if err := recover(); err != nil {

Check failure on line 42 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)

Check failure on line 42 in gql/gql_utils.go

View workflow job for this annotation

GitHub Actions / Lint

commentFormatting: put a space between `//` and comment text (gocritic)
// wrapper.Span.RecordError(fmt.Errorf("panic: %v", err))
Expand Down

0 comments on commit 0eef1d8

Please sign in to comment.