diff options
author | Markus Grüneis <gimpf@gimpf.org> | 2014-10-24 15:38:10 +0200 |
---|---|---|
committer | Markus Grüneis <gimpf@gimpf.org> | 2014-10-24 15:38:10 +0200 |
commit | 347568ed7265f57267f68c11d5ae49b175e8c28c (patch) | |
tree | cc861a239a04306c9946f13aacc190bbb5ca015e /src/hub/src/spreadspace.org/sfive/s5srvWeb.go | |
parent | hub: Add AppendMany support to store. (diff) |
hub: Support posting multiple updates at once via http.
Diffstat (limited to 'src/hub/src/spreadspace.org/sfive/s5srvWeb.go')
-rw-r--r-- | src/hub/src/spreadspace.org/sfive/s5srvWeb.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5srvWeb.go b/src/hub/src/spreadspace.org/sfive/s5srvWeb.go index e13f1a5..2d39740 100644 --- a/src/hub/src/spreadspace.org/sfive/s5srvWeb.go +++ b/src/hub/src/spreadspace.org/sfive/s5srvWeb.go @@ -154,6 +154,14 @@ func (self StatsSinkServer) postUpdate(c web.C, w http.ResponseWriter, r *http.R return } + container := StatisticsDataContainer{} + err = json.Unmarshal(buffer, &container) + if err == nil { + self.appendManyData <- container.Data + return + } + + // else try single value data, err := decoder.Decode(buffer) if err != nil { s5l.Printf("web: failed to decode: %v\n", err) |