summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'worker.js')
-rw-r--r--worker.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/worker.js b/worker.js
index 436fc52..2b3816f 100644
--- a/worker.js
+++ b/worker.js
@@ -190,11 +190,16 @@ amqp.connect(RABBITMQ_URI).then(async (rabbit) => {
} ) );
db_profiler.done("database transaction");
+ if (data.length == 0) {
+ logger.error("no data!");
+ return;
+ }
+
const es_profiler = logger.startTimer();
await elastic.bulk({
body: [].concat(... data.map((d) => [
{ index: {
- _index: `${INDEX}_${d.participant.series.name}`,
+ _index: `${INDEX}_${d["participant.series.name"]}`,
_type: INDEX,
_id: `${d.participant_api_id}@${d.start}+${d.end}`
} },