Optimization

This commit is contained in:
M1ha 2019-01-22 11:58:41 +05:00
parent 056aa0c5f1
commit 780b13a42e

View File

@ -183,7 +183,8 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)):
:return: :return:
""" """
if batch: if batch:
cls.get_database(for_write=True).insert(batch, batch_size=len(batch)) # +10 constant is to avoid 0 insert, generated by infi
cls.get_database(for_write=True).insert(batch, batch_size=len(batch) + 10)
@classmethod @classmethod
def sync_batch_from_storage(cls): def sync_batch_from_storage(cls):