summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarkus Grüneis <gimpf@gimpf.org>2014-10-24 15:38:10 +0200
committerMarkus Grüneis <gimpf@gimpf.org>2014-10-24 15:38:10 +0200
commit347568ed7265f57267f68c11d5ae49b175e8c28c (patch)
treecc861a239a04306c9946f13aacc190bbb5ca015e /src
parenthub: Add AppendMany support to store. (diff)
hub: Support posting multiple updates at once via http.
Diffstat (limited to 'src')
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5srvWeb.go8
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)