attenuator sync

This commit is contained in:
jiangyong27 2024-12-19 11:41:17 +08:00
parent 9481311d65
commit 6acbd2c3e2
1 changed files with 2 additions and 2 deletions

View File

@ -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
}