Skip to content

Commit

Permalink
feat(fxgcppubsub): Fixed race conditions on avro binary codec
Browse files Browse the repository at this point in the history
  • Loading branch information
ekkinox committed Jul 9, 2024
1 parent 76f6495 commit 9cf0a9e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fxgcppubsub/codec/avro.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ var (

// AvroBinaryCodec is a Codec implementation for encoding and decoding with avro schema in binary format.
type AvroBinaryCodec struct {
cache *avro.SchemaCache
api avro.API
schema avro.Schema
}

// NewAvroBinaryCodec returns a new AvroBinaryCodec instance.
func NewAvroBinaryCodec(schemaDefinition string) (*AvroBinaryCodec, error) {
cache := &avro.SchemaCache{}

api := avro.Config{}.Freeze()

schema, err := avro.ParseBytesWithCache([]byte(schemaDefinition), "", cache)
schema, err := avro.ParseBytesWithCache([]byte(schemaDefinition), "", &avro.SchemaCache{})
if err != nil {
return nil, fmt.Errorf("cannot parse avro schema: %w", err)
}
Expand Down

0 comments on commit 9cf0a9e

Please # to comment.