From 80b2bbf1ebd45c99882081927290813bf7cdf64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 19 May 2023 20:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DUserAgent=E5=88=86=E6=9E=90?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BA=A7=E7=94=9F=E7=9A=84=E6=AD=BB=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/stats/user_agent_parser.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/stats/user_agent_parser.go b/internal/stats/user_agent_parser.go index ba61e2e..3ada2a2 100644 --- a/internal/stats/user_agent_parser.go +++ b/internal/stats/user_agent_parser.go @@ -68,6 +68,8 @@ func (this *UserAgentParser) Parse(userAgent string) (result UserAgentParserResu this.locker.RUnlock() this.locker.Lock() + defer this.locker.Unlock() + this.parser.Parse(userAgent) result.OS = this.parser.OSInfo() result.BrowserName, result.BrowserVersion = this.parser.Browser() @@ -95,7 +97,6 @@ func (this *UserAgentParser) Parse(userAgent string) (result UserAgentParserResu this.cacheMap1 = map[string]UserAgentParserResult{} } } - this.locker.Unlock() return }