From ca553001c2a83e42c41d4d3e16b45dc1bc821662 Mon Sep 17 00:00:00 2001 From: Vilsol Date: Sun, 7 Jan 2024 01:21:53 +0200 Subject: [PATCH] fix: no mod views? --- db/postgres/mod.go | 3 ++- gql/gql_utils.go | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/db/postgres/mod.go b/db/postgres/mod.go index 9c4fcf9..5b5fe9e 100644 --- a/db/postgres/mod.go +++ b/db/postgres/mod.go @@ -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) } func GetMods(ctx context.Context, limit int, offset int, orderBy string, order string, search string, unapproved bool) []Mod { diff --git a/gql/gql_utils.go b/gql/gql_utils.go index 9d1b63d..5968c62 100644 --- a/gql/gql_utils.go +++ b/gql/gql_utils.go @@ -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), //)) return TraceWrapper{ - //Span: span, + // Span: span, }, ctx } func (wrapper TraceWrapper) end() { - //defer wrapper.Span.End() + // defer wrapper.Span.End() // //if err := recover(); err != nil { // wrapper.Span.RecordError(fmt.Errorf("panic: %v", err))