[#7] loki: Fix linter issues

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-01-31 14:53:27 +03:00
parent b3ad3335ff
commit 99465e6639
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,8 @@
package main
import (
"fmt"
"os"
"strconv"
"sync"
"time"
@ -19,7 +21,10 @@ func send(loki *loki.Client) {
for j := 0; j < countMsg/countMsgGroup; j++ {
for i := 0; i < countMsgGroup; i++ {
loki.Send(strconv.Itoa(j)+" "+strconv.Itoa(i)+" test log message", time.Now())
err := loki.Send(strconv.Itoa(j)+" "+strconv.Itoa(i)+" test log message", time.Now())
if err != nil {
fmt.Fprintf(os.Stderr, "send: %v", err)
}
}
time.Sleep(20 * time.Millisecond)
}

View file

@ -6,8 +6,9 @@ import (
"time"
)
// Send sends the message to the loki server.
// If the client is disabled, it returns error.
// If the entries channel is full, the message is discarded and returns error
// If the entries channel is full, the message is discarded and returns error.
func (client *Client) Send(msg string, timestamp time.Time) error {
if !client.IsEnabled() {
client.missedMessages++