Skip to content

Commit

Permalink
🔊 Verbose grpc logging
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleSheep2Code committed Jan 26, 2025
1 parent f0d6cb9 commit 96f429e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/internal/grpc/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func (v *Server) ListAttachment(ctx context.Context, request *proto.ListAttachme
}

func (v *Server) UpdateVisibility(ctx context.Context, request *proto.UpdateVisibilityRequest) (*proto.UpdateVisibilityResponse, error) {
log.Debug().Any("request", request).Msg("Update attachment visibility via grpc...")

tx := database.C
if len(request.Id) == 0 && len(request.Rid) == 0 {
return nil, status.Error(codes.InvalidArgument, "you must provide at least one id or random id")
Expand All @@ -77,8 +79,6 @@ func (v *Server) UpdateVisibility(ctx context.Context, request *proto.UpdateVisi
tx = tx.Where("account_id = ?", request.UserId)
}

log.Debug().Any("id", request.Id).Any("rid", request.Rid).Any("user", request.UserId).Msg("Update attachment visibility via grpc...")

var rowsAffected int64
if err := tx.Updates(&models.Attachment{IsIndexable: request.IsIndexable}).Error; err != nil {
return nil, status.Error(codes.Internal, err.Error())
Expand Down

0 comments on commit 96f429e

Please sign in to comment.