Skip to content

Commit

Permalink
account: fix refresh bucket lua script
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-p committed Mar 16, 2022
1 parent 67f6bad commit 288533f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions oio/account/backend.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 288533f

Please sign in to comment.