From 578fc6c9390cfe506d6007a7657f05aea87d91e0 Mon Sep 17 00:00:00 2001 From: M1ha Date: Wed, 19 Dec 2018 11:59:55 +0500 Subject: [PATCH] Bug fix with rank --- src/django_clickhouse/storages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/django_clickhouse/storages.py b/src/django_clickhouse/storages.py index 7675f1e..23eaa05 100644 --- a/src/django_clickhouse/storages.py +++ b/src/django_clickhouse/storages.py @@ -223,9 +223,9 @@ class RedisStorage(Storage): rank_key = self.REDIS_KEY_RANK_TEMPLATE.format(import_key=import_key) ops_key = self.REDIS_KEY_OPS_TEMPLATE.format(import_key=import_key) - top_rank = int(self._redis.get(rank_key)) + top_rank = self._redis.get(rank_key) if top_rank: - res = self._redis.zremrangebyrank(ops_key, 0, top_rank) + res = self._redis.zremrangebyrank(ops_key, 0, int(top_rank)) batch_size = int(res) else: batch_size = 0