fix: handle error from http.ListenAndServe in SteamCache
This commit is contained in:
@@ -80,16 +80,17 @@ func (sc *SteamCache) Run() {
|
|||||||
sc.mu.Unlock()
|
sc.mu.Unlock()
|
||||||
|
|
||||||
sc.LogStats()
|
sc.LogStats()
|
||||||
|
|
||||||
t := time.NewTicker(10 * time.Second)
|
t := time.NewTicker(10 * time.Second)
|
||||||
go func() {
|
go func() {
|
||||||
for range t.C {
|
for range t.C {
|
||||||
// log cache stats
|
|
||||||
sc.LogStats()
|
sc.LogStats()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
http.ListenAndServe(sc.address, sc)
|
err := http.ListenAndServe(sc.address, sc)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sc *SteamCache) LogStats() {
|
func (sc *SteamCache) LogStats() {
|
||||||
|
|||||||
Reference in New Issue
Block a user