1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-12 02:28:05 +02:00

chroe: chore update (#3367)

This commit is contained in:
yonwoo9 2024-07-22 19:37:54 +08:00 committed by GitHub
parent 7eb39d0c39
commit 5bb067a38d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 9 deletions

View File

@ -80,9 +80,6 @@ func (s *source) Load() ([]*config.KeyValue, error) {
return nil, err
}
if err != nil {
return nil, err
}
content := configFile.GetContent()
k := s.options.fileName

View File

@ -28,28 +28,28 @@ type options struct {
tags map[string]interface{}
}
// Repanic configures whether Sentry should repanic after recovery, in most cases it should be set to true.
// WithRepanic repanic configures whether Sentry should repanic after recovery, in most cases it should be set to true.
func WithRepanic(repanic bool) Option {
return func(opts *options) {
opts.repanic = repanic
}
}
// WaitForDelivery configures whether you want to block the request before moving forward with the response.
// WithWaitForDelivery waitForDelivery configures whether you want to block the request before moving forward with the response.
func WithWaitForDelivery(waitForDelivery bool) Option {
return func(opts *options) {
opts.waitForDelivery = waitForDelivery
}
}
// Timeout for the event delivery requests.
// WithTimeout timeout for the event delivery requests.
func WithTimeout(timeout time.Duration) Option {
return func(opts *options) {
opts.timeout = timeout
}
}
// Global tags injection, the value type must be string or log.Valuer
// WithTags global tags injection, the value type must be string or log.Valuer
func WithTags(kvs map[string]interface{}) Option {
return func(opts *options) {
opts.tags = kvs

View File

@ -199,7 +199,7 @@ func (d *Discovery) serverProc() {
apps, err := d.polls(ctx)
if err != nil {
d.switchNode()
if ctx.Err() == context.Canceled {
if errors.Is(ctx.Err(), context.Canceled) {
ctx = nil
continue
}

View File

@ -2,6 +2,7 @@ package zookeeper
import (
"context"
"errors"
"path"
"time"
@ -143,7 +144,7 @@ func (r *Registry) ensureName(path string, data []byte, flags int32) error {
// fixes a race condition if the server crashes without using CreateProtectedEphemeralSequential()
if flags&zk.FlagEphemeral == zk.FlagEphemeral {
err = r.conn.Delete(path, stat.Version)
if err != nil && err != zk.ErrNoNode {
if err != nil && !errors.Is(err, zk.ErrNoNode) {
return err
}
exists = false