- replace all goroutine and AfterFunc with recover version
This commit is contained in:
@@ -40,7 +40,7 @@ func init() {
|
||||
|
||||
func (m *SyncMapWithTimeout) StoreWithTimeout(key, value interface{}, timeout time.Duration) {
|
||||
m.Map.Store(key, value)
|
||||
m.timers.Store(key, time.AfterFunc(timeout, func() {
|
||||
m.timers.Store(key, utils.AfterFuncWithRecover(timeout, func() {
|
||||
m.Delete(key)
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user