From 996ec30de1e9882b5e74d3fd9bf3571c700af2d9 Mon Sep 17 00:00:00 2001 From: SoXX Date: Fri, 1 Nov 2024 21:10:13 +0100 Subject: [PATCH] fix: Remove unused BatchSummery return values in error cases --- pkg/plug/scrape.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/plug/scrape.go b/pkg/plug/scrape.go index ac6680e..f02e13f 100644 --- a/pkg/plug/scrape.go +++ b/pkg/plug/scrape.go @@ -45,7 +45,7 @@ func BatchPostProcessingWithSummery(ctx context.Context, userSource models.UserS span.RecordError(err) span.SetStatus(codes.Error, err.Error()) log.WithContext(ctx).WithError(err).WithFields(BasicLoggingFields).Error("Failed to get Gorm DB") - return nil, nil, BatchSummery{}, err + return nil, nil, err } postIDs := make([]string, 0, len(posts)) @@ -60,7 +60,7 @@ func BatchPostProcessingWithSummery(ctx context.Context, userSource models.UserS span.RecordError(err) span.SetStatus(codes.Error, err.Error()) log.WithContext(ctx).WithError(err).WithFields(BasicLoggingFields).Error("Failed to fetch existing posts") - return nil, nil, BatchSummery{}, err + return nil, nil, err } span.AddEvent("Fetched existing posts", trace.WithAttributes(attribute.Int("existing_post_count", len(existingPostsReferences)))) log.WithContext(ctx).WithFields(BasicLoggingFields).WithField("existing_post_count", len(existingPostsReferences)).Info("Fetched existing posts") @@ -76,7 +76,7 @@ func BatchPostProcessingWithSummery(ctx context.Context, userSource models.UserS span.RecordError(err) span.SetStatus(codes.Error, err.Error()) log.WithContext(ctx).WithError(err).WithFields(BasicLoggingFields).Error("Failed to fetch existing favorite posts") - return nil, nil, BatchSummery{}, err + return nil, nil, err } span.AddEvent("Fetched existing favorite posts", trace.WithAttributes(attribute.Int("existing_fav_post_count", len(existingFavPostIDs)))) log.WithContext(ctx).WithFields(BasicLoggingFields).WithField("existing_fav_post_count", len(existingFavPostIDs)).Info("Fetched existing favorite posts")