From 6cf94fc822d3859d81e3db04e7b47a34d20c3acd Mon Sep 17 00:00:00 2001 From: Jonathan Vuillemin Date: Tue, 9 Jul 2024 09:28:59 +0200 Subject: [PATCH] fix(fxgcppubsub): Fixed race conditions on avro binary codec cache (#20) * fix(fxgcppubsub): Fixed race conditions on avro binary codec * fix(fxgcppubsub): Fixed race conditions on avro binary codec --- fxgcppubsub/codec/avro.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fxgcppubsub/codec/avro.go b/fxgcppubsub/codec/avro.go index d6a5259..3330686 100644 --- a/fxgcppubsub/codec/avro.go +++ b/fxgcppubsub/codec/avro.go @@ -23,7 +23,7 @@ type AvroBinaryCodec struct { func NewAvroBinaryCodec(schemaDefinition string) (*AvroBinaryCodec, error) { api := avro.Config{}.Freeze() - schema, err := avro.Parse(schemaDefinition) + schema, err := avro.ParseBytesWithCache([]byte(schemaDefinition), "", &avro.SchemaCache{}) if err != nil { return nil, fmt.Errorf("cannot parse avro schema: %w", err) }