Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iter9 #8

Closed
wants to merge 12 commits into from
Closed

Iter9 #8

wants to merge 12 commits into from

Conversation

ElizavetaFirst
Copy link
Owner

No description provided.

Copy link

@arttet arttet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -94,3 +114,89 @@ func (u *Uploader) SendCounterMetrics(metrics map[string]int64) error {
}
return nil
}

func (u *Uploader) sendMetricsJSON(url string, metrics metrics.Metrics) error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this function should work with data as bytes

@@ -94,3 +114,89 @@ func (u *Uploader) SendCounterMetrics(metrics map[string]int64) error {
}
return nil
}

func (u *Uploader) sendMetricsJSON(url string, metrics metrics.Metrics) error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (u *Uploader) sendMetricsJSON(url string, metrics metrics.Metrics) error {
func (u *Uploader) sendMetricsJSON(url string, metrics []byte) error {

}
}()

switch resp.Header.Get("Content-Encoding") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if it is in a middleware

c.Set(logger, log)
c.Next()

if err := log.Sync(); err != nil && (!errors.Is(err, syscall.EBADF) && !errors.Is(err, syscall.ENOTTY)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if err := log.Sync(); err != nil && (!errors.Is(err, syscall.EBADF) && !errors.Is(err, syscall.ENOTTY)) {
if err := log.Sync(); err != nil {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need it?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uber-go/zap#328
проблема zap sync на маке, но если не паниковать,то можно и без этого обойтись)

e.tsibereva added 2 commits December 3, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants