dont update more than 400 items a time

This commit is contained in:
Victor Shyba 2021-01-31 02:57:17 -03:00
parent 0cf9533248
commit 7b4838fc9b

View file

@ -76,7 +76,8 @@ class SearchIndex:
to_update.append(doc)
await self.delete(to_delete)
await self.client.indices.refresh(self.index)
await self.update(to_update)
for bulk in range(0, len(to_update), 400):
await self.update(to_update[bulk:bulk+400])
await self.client.indices.refresh(self.index)
async def apply_filters(self, blocked_streams, blocked_channels, filtered_streams, filtered_channels):