less slices

This commit is contained in:
Victor Shyba 2021-03-12 15:43:58 -03:00
parent c3e426c491
commit 6fa7da4b1c

View file

@ -1,5 +1,4 @@
import asyncio
import json
import struct
from binascii import hexlify, unhexlify
from decimal import Decimal
@ -139,20 +138,20 @@ class SearchIndex:
}
return update
if filtered_streams:
await self.client.update_by_query(self.index, body=make_query(1, filtered_streams), slices=32)
await self.client.update_by_query(self.index, body=make_query(1, filtered_streams), slices=4)
await self.client.indices.refresh(self.index)
if filtered_channels:
await self.client.update_by_query(self.index, body=make_query(1, filtered_channels), slices=32)
await self.client.update_by_query(self.index, body=make_query(1, filtered_channels), slices=4)
await self.client.indices.refresh(self.index)
await self.client.update_by_query(self.index, body=make_query(1, filtered_channels, True), slices=32)
await self.client.update_by_query(self.index, body=make_query(1, filtered_channels, True), slices=4)
await self.client.indices.refresh(self.index)
if blocked_streams:
await self.client.update_by_query(self.index, body=make_query(2, blocked_streams), slices=32)
await self.client.update_by_query(self.index, body=make_query(2, blocked_streams), slices=4)
await self.client.indices.refresh(self.index)
if blocked_channels:
await self.client.update_by_query(self.index, body=make_query(2, blocked_channels), slices=32)
await self.client.update_by_query(self.index, body=make_query(2, blocked_channels), slices=4)
await self.client.indices.refresh(self.index)
await self.client.update_by_query(self.index, body=make_query(2, blocked_channels, True), slices=32)
await self.client.update_by_query(self.index, body=make_query(2, blocked_channels, True), slices=4)
await self.client.indices.refresh(self.index)
self.search_cache.clear()
self.claim_cache.clear()