1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Remove the sleeps from the cryptocurrecy modules. Don't need them

This commit is contained in:
Chris Cummer
2018-06-06 15:03:59 -07:00
parent 3a7a0cc9ea
commit ce38c3f754
2 changed files with 19 additions and 47 deletions

View File

@@ -28,7 +28,7 @@ type TextColors struct {
var ok = true
var errorText = ""
var started = false
var baseURL = "https://bittrex.com/api/v1.1/public/getmarketsummary"
// Widget define wtf widget to register widget later
@@ -40,13 +40,11 @@ type Widget struct {
// NewWidget Make new instance of widget
func NewWidget() *Widget {
widget := Widget{
TextWidget: wtf.NewTextWidget(" Bittrex ", "bittrex", false),
summaryList: summaryList{},
}
started = false
ok = true
errorText = ""
@@ -106,20 +104,9 @@ func (widget *Widget) Refresh() {
return
}
if started == false {
go func() {
for {
widget.updateSummary()
time.Sleep(time.Second * time.Duration(widget.RefreshInterval()))
}
}()
started = true
}
widget.updateSummary()
widget.UpdateRefreshedAt()
widget.display()
}
/* -------------------- Unexported Functions -------------------- */