Bug fix with rank

This commit is contained in:
M1ha 2018-12-19 11:59:55 +05:00
parent 95bf0ab520
commit 578fc6c939

View File

@ -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