diff --git a/oio/account/backend.py b/oio/account/backend.py index 2579e77d97..93ec6e2d0b 100644 --- a/oio/account/backend.py +++ b/oio/account/backend.py @@ -1,5 +1,5 @@ # Copyright (C) 2015-2020 OpenIO SAS, as part of OpenIO SDS -# Copyright (C) 2021 OVH SAS +# Copyright (C) 2021-2022 OVH SAS # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -160,7 +160,6 @@ class AccountBackend(RedisConnection): local containers = redis.call('ZRANGEBYLEX', clistkey, marker, '+', 'LIMIT', 0, batch_size); - local i; for i, container_name in ipairs(containers) do local ckey = ckey_prefix .. container_name; @@ -201,7 +200,7 @@ class AccountBackend(RedisConnection): redis.call('HSET', lkey, 'marker', new_marker, 'mtime', mtime); - if i ~= batch_size then + if table.getn(containers) <= tonumber(batch_size) then redis.call('DEL', lkey) return { 1 } end;