Commit 59c140fb authored by Yusei Tahara's avatar Yusei Tahara

Make sure that catalog knows portal_type column and reference column. If...

Make sure that catalog knows portal_type column and reference column. If catalog does not know those columns, then it will fetch all cataloged objects and will cause memory bloat. This can happen when MariaDB server disk is full.
parent c9a3ec7f
...@@ -69,6 +69,8 @@ def getUserByLogin(portal, login, exact_match=True): ...@@ -69,6 +69,8 @@ def getUserByLogin(portal, login, exact_match=True):
reference_key = 'ExactMatch' reference_key = 'ExactMatch'
else: else:
reference_key = 'Keyword' reference_key = 'Keyword'
if not (portal.portal_catalog.hasColumn('portal_type') and portal.portal_catalog.hasColumn('reference')):
raise RuntimeError('Catalog does not have column information. Make sure RDB is working and disk is not full.')
result = portal.portal_catalog.unrestrictedSearchResults( result = portal.portal_catalog.unrestrictedSearchResults(
select_expression='reference', select_expression='reference',
portal_type="Person", portal_type="Person",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment