diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-08 00:00:33 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-08 00:00:33 +0200 |
| commit | 1af24ac18a2b6f1b1f1d8aa5b62cebef383caf5b (patch) | |
| tree | 1a9eeef0008ee5f8df0572148e895b0682dc2ba9 /server.js | |
| parent | 4e85c8f9e32d556e0f8682f9ecbae1e4a8bf49e6 (diff) | |
| download | bridge-1af24ac18a2b6f1b1f1d8aa5b62cebef383caf5b.tar.gz bridge-1af24ac18a2b6f1b1f1d8aa5b62cebef383caf5b.zip | |
implement simple sample downloads
Diffstat (limited to 'server.js')
| -rw-r--r-- | server.js | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -60,7 +60,7 @@ function requestUpdate(name, region, last_match_created_date, id) { }; console.log("requesting update for", name, region); return ch.sendToQueue("grab", new Buffer(JSON.stringify(payload)), - { persistent: true }); + { persistent: true, type: "matches" }); } // search for player name on all shards @@ -159,6 +159,19 @@ app.post("/api/player", async (req, res) => { await updatePlayer(player); res.json(player); }); +// download sample sets +// (TODO download only samples since last update) +app.post("/api/samples", async (req, res) => { + await ch.sendToQueue("grab", new Buffer( + JSON.stringify({ + region: "eu", + params: { + sort: "-createdAt" + } + })), + { persistent: true, type: "samples" }); + res.sendStatus(204); +}); // crunch data app.post("/api/stats/:dimension_on/update", async (req, res) => { |
