We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8038b19 commit 6c77b44Copy full SHA for 6c77b44
1 file changed
tools/tokenserver/purge_old_records.py
@@ -64,7 +64,7 @@ def purge_old_records(
64
logger.info("Purging old user records")
65
try:
66
database = Database()
67
- previous_list = []
+ previous_uids = set()
68
# Process batches of <max_per_loop> items, until we run out.
69
while True:
70
offset = random.randint(0, max_offset)
@@ -78,9 +78,10 @@ def purge_old_records(
78
if not rows:
79
logger.info("No more data")
80
break
81
- if rows == previous_list:
+ current_uids = {row.uid for row in rows}
82
+ if current_uids == previous_uids:
83
raise Exception("Loop detected")
- previous_list = rows
84
+ previous_uids = current_uids
85
range_msg = ""
86
if uid_range:
87
range_msg = (
0 commit comments