plone / plone.app.users

User registration and profile forms for the Plone CMS
https://pypi.python.org/pypi/plone.app.users
14 stars 22 forks source link

Provide a new schema adapter only when the TTW schema is changed #44

Closed ebrehault closed 9 years ago

ebrehault commented 9 years ago

Providing a new adapter everytime we render a form might produce memomry leak. This PR makes sure we only do that only when the schema actually changes.

ebrehault commented 9 years ago

http://jenkins.plone.org/job/pull-request-5.0/145/

ebrehault commented 9 years ago

@gotcha I think I have a better implementation now, the utility is now an instance, not a factory anymore, it is instanciated when we start the server (in a __init__.py) and last forever (it replaces the volatile cache we had on the factory), it has a initialize method which is in charge of loading the current schema and providing the adapter for the form. As a result, we only call provideAdapter once the first time we need it, and never again unless we actually edit the schema (plus we do not need the getCopyOfSchema thing anymore).

@bloodbare @tisto: FYI here is a better fix for the memory leak issue we had last week before merging, but it is not mergeable yet because it breaks some tests in Products.CMFPlone and in Products.PasswordResetTool. I am working on it.

ebrehault commented 9 years ago

I'll make a new PR based on last @gotcha changes