- bug fix.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package jxutils
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -18,6 +19,10 @@ type SyncMapWithTimeout struct {
|
||||
sync.Map
|
||||
}
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().Unix())
|
||||
}
|
||||
|
||||
func (m *SyncMapWithTimeout) StoreWithTimeout(key, value interface{}, timeout time.Duration) {
|
||||
m.Map.Store(key, value)
|
||||
time.AfterFunc(timeout, func() {
|
||||
|
||||
Reference in New Issue
Block a user