summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-10 21:10:55 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-10 21:10:55 +0200
commitfc3881a7379cfc061fce3a5ac74ee9150909f707 (patch)
treea8313757e1171b6339ba04815adc7dd49db5dfd0 /server.js
parent9c640db98ac68bae9b77b5b36240957fb86f05f8 (diff)
downloadbridge-fc3881a7379cfc061fce3a5ac74ee9150909f707.tar.gz
bridge-fc3881a7379cfc061fce3a5ac74ee9150909f707.zip
add global crunch API
Diffstat (limited to 'server.js')
-rw-r--r--server.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/server.js b/server.js
index 235723d..eb800f5 100644
--- a/server.js
+++ b/server.js
@@ -191,6 +191,13 @@ app.post("/api/samples", async (req, res) => {
{ persistent: true, type: "samples" });
res.sendStatus(204);
});
+// crunch global stats
+app.post("/api/crunch", async (req, res) => {
+ console.log("crunching global stats");
+ await ch.sendToQueue("crunch", new Buffer(""),
+ { persistent: true, type: "global" });
+ res.sendStatus(204);
+});
// crunch data
app.post("/api/stats/:dimension_on/update", async (req, res) => {