mirror of https://github.com/statping/statping
Merge pull request #880 from thatInfrastructureGuy/BugFix/chartReloadIssue
Bug fix: Deleting from empty map.pull/859/head^2
commit
6ca0f22665
|
@ -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
|
||||||
|
@ -90,8 +91,8 @@ func (s Storage) List() map[string]Item {
|
||||||
//Get a cached content by key
|
//Get a cached content by key
|
||||||
func (s Storage) Get(key string) []byte {
|
func (s Storage) Get(key string) []byte {
|
||||||
item := s.items[key]
|
item := s.items[key]
|
||||||
if s.items[key].Expired() {
|
if item.Expired() {
|
||||||
CacheStorage.Delete(key)
|
s.Delete(key)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return item.Content
|
return item.Content
|
||||||
|
|
Loading…
Reference in New Issue