Skip to content

Commit

Permalink
reload portfolio data
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Nov 24, 2017
1 parent e105ae8 commit 61e600d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/lweb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@ func main() {
}()

if len(stockConfigFileName) > 0 {
var sLoadData portfolioConfigStruct
toml.DecodeFile(stockConfigFileName, &sLoadData)
portfolioConfigData = sLoadData
go func() {
for {
var sLoadData portfolioConfigStruct
toml.DecodeFile(stockConfigFileName, &sLoadData)
portfolioConfigData = sLoadData
time.Sleep(time.Minute * 5)
}
}()
}

// initialize cache
Expand Down

0 comments on commit 61e600d

Please sign in to comment.