From fc3881a7379cfc061fce3a5ac74ee9150909f707 Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 10 Apr 2017 21:10:55 +0200 Subject: add global crunch API --- server.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server.js') 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) => { -- cgit v1.3.1