Pull request: all: fix some races

Updates .

Squashed commit of the following:

commit e888ce524f286f3c34e14e0086336b65a95fa020
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon May 17 16:34:10 2021 +0300

    all: fix some races
This commit is contained in:
Ainar Garipov 2021-05-17 16:50:02 +03:00
parent d9ae6dbcc3
commit 5acae6e204
6 changed files with 30 additions and 13 deletions
internal/home

View file

@ -86,7 +86,13 @@ func handleI18nChangeLanguage(w http.ResponseWriter, r *http.Request) {
return
}
config.Language = language
func() {
config.Lock()
defer config.Unlock()
config.Language = language
}()
onConfigModified()
returnOK(w)
}