Skip to content

Commit 288533f

Browse files
committed
account: fix refresh bucket lua script
1 parent 67f6bad commit 288533f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

oio/account/backend.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (C) 2015-2020 OpenIO SAS, as part of OpenIO SDS
2-
# Copyright (C) 2021 OVH SAS
2+
# Copyright (C) 2021-2022 OVH SAS
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as
@@ -160,7 +160,6 @@ class AccountBackend(RedisConnection):
160160
local containers = redis.call('ZRANGEBYLEX', clistkey,
161161
marker, '+', 'LIMIT', 0, batch_size);
162162
163-
local i;
164163
for i, container_name in ipairs(containers) do
165164
local ckey = ckey_prefix .. container_name;
166165
@@ -201,7 +200,7 @@ class AccountBackend(RedisConnection):
201200
202201
redis.call('HSET', lkey, 'marker', new_marker,
203202
'mtime', mtime);
204-
if i ~= batch_size then
203+
if table.getn(containers) <= tonumber(batch_size) then
205204
redis.call('DEL', lkey)
206205
return { 1 }
207206
end;

0 commit comments

Comments
 (0)