1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 18:10:49 +09:00

GO-2050 Fix lint

This commit is contained in:
Mikhail Iudin 2023-12-01 14:07:21 +01:00
parent 867d3d04d9
commit 129b2e70e5
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
5 changed files with 7 additions and 12 deletions

View file

@ -80,7 +80,7 @@ func (c *Client) SendEvents(amplEvents []Event, info AppInfoProvider) error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer func() {
cancel()
//flush arena
// flush arena
arena.Reset()
c.arenaPool.Put(arena)
}()

View file

@ -2,6 +2,7 @@ package metrics
import (
"context"
"errors"
"sync"
"time"
@ -68,7 +69,7 @@ func (c *client) startSendingBatchMessages(info amplitude.AppInfoProvider) {
ctx = mb.CtxWithTimeLimit(ctx, time.Minute)
msgs, err := b.NewCond().WithMin(10).WithMax(100).Wait(ctx)
if err == mb.ErrClosed {
if errors.Is(err, mb.ErrClosed) {
close(c.closeChannel)
return
}
@ -119,7 +120,7 @@ func (c *client) sendNextBatch(info amplitude.AppInfoProvider, b *mb.MB[amplitud
With("unsent messages", len(msgs)+c.batcher.Len()).
Error("failed to send messages")
if b != nil {
b.Add(c.ctx, msgs...)
b.Add(c.ctx, msgs...) //nolint:errcheck
}
} else {
clientMetricsLog.
@ -160,5 +161,5 @@ func (c *client) send(e amplitude.Event) {
if b == nil {
return
}
b.Add(c.ctx, e)
_ = b.Add(c.ctx, e) //nolint:errcheck
}

View file

@ -400,10 +400,3 @@ func (c MethodEvent) MarshalFastJson(arena *fastjson.Arena) amplitude.JsonEvent
properties.Set("description", arena.NewString(c.description))
return event
}
type MethodSuccessEvent struct {
baseInfo
methodName string
errorCode int64
description string
}

View file

@ -28,7 +28,7 @@ const (
)
const amplEndpoint = "https://amplitude.anytype.io/2/httpapi"
const inhouseEndpoint = "https://inhouse.anytype.io/2/httpapi" //todo change to inhouse
const inhouseEndpoint = "https://metrics.anytype.io/2/httpapi"
type SamplableEvent interface {
amplitude.Event