fix concurrent field creation race condition

This commit is contained in:
Matt Jaffee 2019-09-23 07:54:01 -05:00
parent ac8c4ed5fe
commit 07f8f5b8e0
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

View file

@ -601,7 +601,7 @@ func (s *Server) receiveMessage(m Message) error {
return fmt.Errorf("local index not found: %s", obj.Index)
}
opt := obj.Meta
_, err := idx.createField(obj.Field, *opt)
_, err := idx.createFieldIfNotExists(obj.Field, *opt)
if err != nil {
return err
}