diff --git a/cryptolive/widget.go b/cryptolive/widget.go index 8ddf2408..fce5ae45 100644 --- a/cryptolive/widget.go +++ b/cryptolive/widget.go @@ -21,7 +21,8 @@ var started = false type Widget struct { wtf.TextWidget - CurrentIcon int + // time interval for send http request + updateInterval int *list } @@ -30,7 +31,8 @@ type Widget struct { func NewWidget() *Widget { started = false widget := Widget{ - TextWidget: wtf.NewTextWidget(" $ CryptoLive ", "cryptolive", false), + TextWidget: wtf.NewTextWidget(" $ CryptoLive ", "cryptolive", false), + updateInterval: Config.UInt("wtf.mods.cryptolive.updateInterval", 10), } currenciesMap, _ := Config.Map("wtf.mods.cryptolive.currencies") @@ -73,7 +75,7 @@ func (widget *Widget) Refresh() { go func() { for { widget.updateCurrencies() - time.Sleep(time.Duration(widget.RefreshInterval()) * time.Second) + time.Sleep(time.Duration(widget.updateInterval) * time.Second) } }() @@ -129,5 +131,4 @@ func (widget *Widget) updateCurrencies() { } } - }