Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrs4s committed Aug 3, 2020
1 parent 6484727 commit 548911e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions utils/ttl.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

type TTList struct {
list []*item
lock *sync.Mutex
lock sync.Mutex
}

type item struct {
Expand All @@ -16,9 +16,7 @@ type item struct {
}

func NewTTList(ttl int64) *TTList {
l := &TTList{
lock: new(sync.Mutex),
}
l := &TTList{}
go func() {
for now := range time.Tick(time.Second * 5) {
l.lock.Lock()
Expand Down

0 comments on commit 548911e

Please sign in to comment.