diff options
Diffstat (limited to 'src/hub/src')
-rw-r--r-- | src/hub/src/spreadspace.org/sfive/s5srvForward.go | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5srvForward.go b/src/hub/src/spreadspace.org/sfive/s5srvForward.go index 475027a..4707dd5 100644 --- a/src/hub/src/spreadspace.org/sfive/s5srvForward.go +++ b/src/hub/src/spreadspace.org/sfive/s5srvForward.go @@ -69,28 +69,28 @@ tryResync: continue nextBatch } - for i := range updates { - data, err := json.Marshal(updates[i]) - if err != nil { - s5l.Panicf("fwd: encode failed: %v\n", err) - // TODO retry etc. - } - - _, err = client.Post(url, "application/json", bytes.NewBuffer(data)) - if err != nil { - s5l.Printf("fwd: post failed: %v\n", err) - continue tryResync - // TODO retry etc. - } - } - if len(updates) == 0 { time.Sleep(1 * time.Second) - } else { - lastId = findMaxId(updates) - s5tl.Printf("fwd: new lastid: %d", lastId) - time.Sleep(100 * time.Millisecond) + continue nextBatch } + + data, err := json.Marshal(StatisticsDataContainer{updates}) + + if err != nil { + s5l.Panicf("fwd: encode failed: %v\n", err) + } + + _, err = client.Post(url, "application/json", bytes.NewBuffer(data)) + if err != nil { + s5l.Printf("fwd: post failed: %v\n", err) + continue tryResync + // TODO retry etc. + } + // } + + lastId = findMaxId(updates) + s5tl.Printf("fwd: new lastid: %d", lastId) + time.Sleep(100 * time.Millisecond) } } } |