Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a pointer for BaseClient.productCheckMu #905

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ type BaseClient struct {
compatibilityHeader bool

disableMetaHeader bool
productCheckMu sync.RWMutex
productCheckMu *sync.RWMutex
productCheckSuccess bool
}

Expand Down Expand Up @@ -190,6 +190,7 @@ func NewClient(cfg Config) (*Client, error) {
disableMetaHeader: cfg.DisableMetaHeader,
metaHeader: initMetaHeader(tp),
compatibilityHeader: cfg.EnableCompatibilityMode || compatibilityHeader,
productCheckMu: new(sync.RWMutex),
},
}
client.API = esapi.New(client)
Expand Down Expand Up @@ -223,6 +224,7 @@ func NewTypedClient(cfg Config) (*TypedClient, error) {
disableMetaHeader: cfg.DisableMetaHeader,
metaHeader: metaHeader,
compatibilityHeader: cfg.EnableCompatibilityMode || compatibilityHeader,
productCheckMu: new(sync.RWMutex),
},
}
client.API = typedapi.New(client)
Expand Down