mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
update.
This commit is contained in:
parent
6484727e59
commit
548911eb9c
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
type TTList struct {
|
type TTList struct {
|
||||||
list []*item
|
list []*item
|
||||||
lock *sync.Mutex
|
lock sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
type item struct {
|
type item struct {
|
||||||
@ -16,9 +16,7 @@ type item struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewTTList(ttl int64) *TTList {
|
func NewTTList(ttl int64) *TTList {
|
||||||
l := &TTList{
|
l := &TTList{}
|
||||||
lock: new(sync.Mutex),
|
|
||||||
}
|
|
||||||
go func() {
|
go func() {
|
||||||
for now := range time.Tick(time.Second * 5) {
|
for now := range time.Tick(time.Second * 5) {
|
||||||
l.lock.Lock()
|
l.lock.Lock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user