Skip to content

Commit 72b1b97

Browse files
committed
init commit
1 parent 6686d72 commit 72b1b97

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎connectors/es/sink.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ def _populate_stats(self, stats, res):
307307
for op, data in item.items():
308308
# "result" is only present in successful operations
309309
if "result" not in data:
310-
del stats[op][data["_id"]]
310+
try:
311+
del stats[op][data["_id"]]
312+
except KeyError:
313+
self._logger.info(f"KeyError in _populate_stats: {op}, {data['_id']}")
311314

312315
self.counters.increment(
313316
INDEXED_DOCUMENT_COUNT, len(stats[OP_INDEX]) + len(stats[OP_UPDATE])
@@ -367,6 +370,7 @@ async def _run(self):
367370
while True:
368371
batch_num += 1
369372
doc_size, doc = await self.fetch_doc()
373+
print(f"Sink: fetched doc {doc}")
370374
if doc in (END_DOCS, EXTRACTOR_ERROR):
371375
break
372376
operation = doc["_op_type"]

0 commit comments

Comments
 (0)