mirror of https://github.com/statping/statping
Update cache.go
parent
dfac079f8c
commit
7e9d8c2951
|
@ -1,10 +1,11 @@
|
||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/statping/statping/utils"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/statping/statping/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CacheStorage Cacher
|
var CacheStorage Cacher
|
||||||
|
@ -92,7 +93,7 @@ func (s Storage) Get(key string) []byte {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
item := s.items[key]
|
item := s.items[key]
|
||||||
if item.Expired() {
|
if s.items[key].Expired() {
|
||||||
CacheStorage.Delete(key)
|
CacheStorage.Delete(key)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue