Merge branch 'v0.1'

Conflicts:
	models/nodes.go
This commit is contained in:
root 2016-05-21 13:13:56 +02:00
commit 743ef30532

View File

@ -105,7 +105,7 @@ func (nodes *Nodes) Update(nodeID string, res *data.ResponseData) {
// Periodically saves the cached DB to json file
func (nodes *Nodes) worker() {
c := time.Tick(time.Second * 5)
c := time.Tick(time.Second * time.Duration(nodes.config.Nodes.SaveInterval))
for range c {
log.Println("saving", len(nodes.List), "nodes")
@ -114,7 +114,7 @@ func (nodes *Nodes) worker() {
//
// set node as offline (without statistics)
for _,node := range nodes.List {
if node.Statistics != nil && node.Lastseen.Unix()+int64(5*nodes.config.Respondd.CollectInterval) < nodes.Timestamp.Unix() {
if node.Statistics != nil && node.Lastseen.Unix()+int64(1000*nodes.config.Respondd.CollectInterval) < nodes.Timestamp.Unix() {
node.Statistics = &MeshviewerStatistics{
NodeId: node.Statistics.NodeId,
Clients: 0,