Fix data race for config with FileSource (#26518)

Signed-off-by: yah01 <yah2er0ne@outlook.com>
pull/26604/head
yah01 2023-08-24 09:18:24 +08:00 committed by GitHub
parent c2b53bb9fe
commit c3f5856fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -91,6 +91,8 @@ func (fs *FileSource) Close() {
}
func (fs *FileSource) SetEventHandler(eh EventHandler) {
fs.RWMutex.Lock()
defer fs.RWMutex.Unlock()
fs.configRefresher.eh = eh
}