From 6acbd2c3e2ea3daa6412ac455435d3ff176c892e Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Thu, 19 Dec 2024 11:41:17 +0800 Subject: [PATCH] attenuator sync --- attenuator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attenuator.go b/attenuator.go index 282e2c6..cd31e57 100644 --- a/attenuator.go +++ b/attenuator.go @@ -26,7 +26,7 @@ func (a *Attenuator) Do(key string, fun func()) bool { val := a.memory.Get(key) if val == nil { - go fun() + fun() a.memory.Set(key, fmt.Sprintf("%d,1", time.Now().Unix()), time.Hour*time.Duration(24*365*100)) return true } @@ -42,7 +42,7 @@ func (a *Attenuator) Do(key string, fun func()) bool { return false } - go fun() + fun() a.memory.Set(key, fmt.Sprintf("%d,%d", nowTime, count), time.Hour*time.Duration(24*365*100)) return true }