From 36123db73e71236d231e4c44881be373029ec01f Mon Sep 17 00:00:00 2001 From: M1ha Date: Wed, 19 Dec 2018 12:52:47 +0500 Subject: [PATCH] Fix time between batches count --- src/django_clickhouse/clickhouse_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/django_clickhouse/clickhouse_models.py b/src/django_clickhouse/clickhouse_models.py index 1367532..d6054a7 100644 --- a/src/django_clickhouse/clickhouse_models.py +++ b/src/django_clickhouse/clickhouse_models.py @@ -213,7 +213,7 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)): with statsd.timer(statsd_key.format('steps.post_sync')): storage.post_sync(import_key) - storage.set_last_sync_time(import_key, now()) + storage.set_last_sync_time(import_key, datetime.datetime.now()) except RedisLockTimeoutError: pass # skip this sync round if lock is acquired by another thread @@ -280,7 +280,7 @@ class ClickHouseMultiModel(ClickHouseModel): with statsd.timer(statsd_key.format('steps.post_sync')): storage.post_sync(import_key) - storage.set_last_sync_time(import_key, now()) + storage.set_last_sync_time(import_key, datetime.datetime.now()) except RedisLockTimeoutError: pass # skip this sync round if lock is acquired by another thread