mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-22 09:06:43 +03:00
Fix choosing connection on syncing
This commit is contained in:
parent
0829e5bacd
commit
2dc8e7a270
|
@ -54,7 +54,6 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)):
|
|||
sync_batch_size = None
|
||||
sync_storage = None
|
||||
sync_delay = None
|
||||
sync_database_alias = None
|
||||
sync_lock_timeout = None
|
||||
|
||||
# This attribute is initialized in metaclass, as it must get model class as a parameter
|
||||
|
@ -174,8 +173,7 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)):
|
|||
:return:
|
||||
"""
|
||||
if batch:
|
||||
conn = connections[cls.sync_database_alias]
|
||||
conn.insert(batch)
|
||||
cls.get_database(for_write=True).insert(batch)
|
||||
|
||||
@classmethod
|
||||
def sync_batch_from_storage(cls):
|
||||
|
|
Loading…
Reference in New Issue
Block a user