From 77fd0e4ece334767fda6bac23ca484f0fc7aa9b4 Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Mon, 12 Oct 2015 08:48:33 -0500 Subject: [PATCH] load report config periodically --- src/cmd/lweb/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd/lweb/main.go b/src/cmd/lweb/main.go index 1b14d463..a01b21a1 100644 --- a/src/cmd/lweb/main.go +++ b/src/cmd/lweb/main.go @@ -48,10 +48,12 @@ type reportConfig struct { Exclude []string `toml:"exclude"` } -var rLoadData, reportConfigData struct { +type reportConfigStruct struct { Reports []reportConfig `toml:"report"` } +var reportConfigData reportConfigStruct + type pageData struct { Reports []reportConfig Transactions []*ledger.Transaction @@ -76,6 +78,7 @@ func main() { go func() { for { + var rLoadData reportConfigStruct toml.DecodeFile(reportConfigFileName, &rLoadData) reportConfigData = rLoadData time.Sleep(time.Minute * 5)