0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

fix(sync): fix data race when pinging registries by read-locking (#1924)

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
peusebiu 2023-10-12 11:00:33 +03:00 committed by GitHub
parent 556c0660bd
commit 04048e5ad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,6 +73,9 @@ func (httpClient *Client) SetConfig(config Config) error {
}
func (httpClient *Client) Ping() bool {
httpClient.lock.RLock()
defer httpClient.lock.RUnlock()
pingURL := *httpClient.url
pingURL = *pingURL.JoinPath("/v2/")