Skip to content

Commit

Permalink
Update to xsync v3 (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao authored Mar 10, 2024
1 parent 497e77b commit da55a5e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/procfs v0.12.0
github.com/puzpuzpuz/xsync v1.5.2
github.com/puzpuzpuz/xsync/v3 v3.1.0
github.com/redis/go-redis/v9 v9.5.1
github.com/stretchr/testify v1.9.0
github.com/twitchtv/twirp v8.1.3+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSz
github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/puzpuzpuz/xsync v1.5.2 h1:yRAP4wqSOZG+/4pxJ08fPTwrfL0IzE/LKQ/cw509qGY=
github.com/puzpuzpuz/xsync v1.5.2/go.mod h1:K98BYhX3k1dQ2M63t1YNVDanbwUPmBCAhNmVrrxfiGg=
github.com/puzpuzpuz/xsync/v3 v3.1.0 h1:EewKT7/LNac5SLiEblJeUu8z5eERHrmRLnMQL2d7qX4=
github.com/puzpuzpuz/xsync/v3 v3.1.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA=
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
Expand Down
4 changes: 2 additions & 2 deletions logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"

"github.com/go-logr/logr"
"github.com/puzpuzpuz/xsync"
"github.com/puzpuzpuz/xsync/v3"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

Expand Down Expand Up @@ -198,7 +198,7 @@ func NewZapLogger(conf *Config, opts ...ZapLoggerOption) (ZapLogger, error) {
zc := &zapConfig{
conf: conf,
sc: newSharedConfig(conf),
writeEnablers: xsync.NewMapOf[*zaputil.WriteEnabler](),
writeEnablers: xsync.NewMapOf[string, *zaputil.WriteEnabler](),
tap: zaputil.NewDiscardWriteEnabler(),
}
for _, opt := range opts {
Expand Down
4 changes: 2 additions & 2 deletions rpc/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"time"

"github.com/puzpuzpuz/xsync"
"github.com/puzpuzpuz/xsync/v3"
"google.golang.org/protobuf/proto"

"github.com/livekit/protocol/logger"
Expand All @@ -30,7 +30,7 @@ type loggerCache struct {
}

func newLoggerCache() loggerCache {
return loggerCache{m: xsync.NewMapOf[logger.Logger]()}
return loggerCache{m: xsync.NewMapOf[string, logger.Logger]()}
}

func (c loggerCache) Get(info psrpc.RPCInfo, l logger.Logger) logger.Logger {
Expand Down

0 comments on commit da55a5e

Please sign in to comment.