Skip to content

Commit

Permalink
replaced updateInterval with refreshInterval
Browse files Browse the repository at this point in the history
  • Loading branch information
jeangovil authored and senorprogrammer committed Jun 5, 2018
1 parent 2122c50 commit 6e7307e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions _site/content/posts/modules/cryptocurrencies/bittrex.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bittrex:
left: 2
height: 3
width: 1
updateInterval: 5
refreshInterval: 5
summary:
BTC:
displayName: Bitcoin
Expand Down Expand Up @@ -80,6 +80,6 @@ Values: `true`, `false`.
`position` <br />
Defines where in the grid this module's widget will be displayed. <br />

`updateInterval` <br />
`refreshInterval` <br />
How often, in seconds, this module will update its data. <br />
Values: A positive integer, `0..n`.
8 changes: 3 additions & 5 deletions cryptoexchanges/bittrex/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,15 @@ var baseURL = "https://bittrex.com/api/v1.1/public/getmarketsummary"
type Widget struct {
wtf.TextWidget
summaryList
updateInterval int
TextColors
}

// NewWidget Make new instance of widget
func NewWidget() *Widget {

widget := Widget{
TextWidget: wtf.NewTextWidget(" $ Bittrex ", "bittrex", false),
summaryList: summaryList{},
updateInterval: Config.UInt("wtf.mods.bittrex.updateInterval", 10),
TextWidget: wtf.NewTextWidget(" $ Bittrex ", "bittrex", false),
summaryList: summaryList{},
}

started = false
Expand Down Expand Up @@ -112,7 +110,7 @@ func (widget *Widget) Refresh() {
go func() {
for {
widget.updateSummary()
time.Sleep(time.Second * time.Duration(widget.updateInterval))
time.Sleep(time.Second * time.Duration(widget.RefreshInterval()))
}
}()
started = true
Expand Down
2 changes: 1 addition & 1 deletion docs/posts/modules/bittrex/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ <h2 id="configuration">Configuration</h2>
</span><span class="w"> </span>left<span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="w">
</span><span class="w"> </span>height<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>width<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
</span><span class="w"> </span>updateInterval<span class="p">:</span><span class="w"> </span><span class="m">15</span><span class="w">
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">15</span><span class="w">
</span><span class="w"> </span>summary<span class="p">:</span><span class="w"> </span><span class="w">
</span><span class="w"> </span>BTC<span class="p">:</span><span class="w">
</span><span class="w"> </span>displayName<span class="p">:</span><span class="w"> </span><span class="m">Bitcoin</span><span class="w">
Expand Down

0 comments on commit 6e7307e

Please sign in to comment.