Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: no mod views? #42

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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,19 +27,19 @@
}

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))
// panic(err)
//}
Expand Down
Loading