Skip to content

Commit

Permalink
fix upgrade-step
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Oct 15, 2024
1 parent 2c2aea1 commit 4305980
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/redturtle/volto/upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,14 @@ def to_4308(context):
catalog = api.portal.get_tool(name="portal_catalog")
brains = catalog()
tot = len(brains)

logger.info(f"Reindexing {tot} items.")
i = 0
for brain in brains:
i += 1
obj = brain.getObject()
if i % 100 == 0:
logger.info(f"Progress: {i}/{tot}")
catalog.catalog_object(obj, idxs=["SearchableText"], update_metadata=False)
if i % 1000 == 0:
transaction.commit()
logger.info(f"{i} items processed. Commit.")
catalog.catalog_object(obj, idxs=["SearchableText"], update_metadata=False)
if i % 1000 == 0:
transaction.commit()
logger.info(f"{i} items processed. Commit.")

0 comments on commit 4305980

Please sign in to comment.