diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-12 19:13:52 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-12 19:13:52 +0200 |
| commit | 720c680c0902fcc3a3c56457120416a7893480d9 (patch) | |
| tree | a613c3bdfa673c584b2bd7b1a78cd460e667a6ec | |
| parent | b261d7ebdcbb839abe216d5d5ac8c562504c0a1a (diff) | |
| download | apigrabber-720c680c0902fcc3a3c56457120416a7893480d9.tar.gz apigrabber-720c680c0902fcc3a3c56457120416a7893480d9.zip | |
send matches_none on no matches for playerrelease/2.3.1
| -rw-r--r-- | worker.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -69,7 +69,7 @@ if (LOGGLY_TOKEN) // loop over API data objects async function getAPI(payload, where, notify="global") { - await Promise.each(await api.requests(where, + const data = await Promise.each(await api.requests(where, payload.region, payload.params, logger), async (data, idx, len) => { if (where == "matches") // send match structure @@ -84,8 +84,12 @@ if (LOGGLY_TOKEN) await ch.sendToQueue(SAMPLE_QUEUE, new Buffer(JSON.stringify(data.attributes.URL)), { persistent: true, type: "sample" }); + return data; } ); + if (data.length == 0 && notify) + await ch.publish("amq.topic", notify, + new Buffer("matches_none")); } })(); |
