Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimise by not loading auth_event every request #1525

Open
flavour opened this issue Nov 28, 2019 · 1 comment · May be fixed by #1528
Open

Optimise by not loading auth_event every request #1525

flavour opened this issue Nov 28, 2019 · 1 comment · May be fixed by #1528

Comments

@flavour
Copy link
Member

flavour commented Nov 28, 2019

Every request loads all tables used by AuthS3() in modules/s3/s3aaa.py
This currently includes the table 'auth_event' which is really not necessary as this only gets used as part of the user-login use case.
Ideally this should be moved to it's own class in modules/s3db/auth.py so that it is only loaded when required.
This will mean the table has to be instantiated via s3db. instead of just db.

@hallamoore
Copy link
Contributor

So if I'm following correctly, the place where this table is actually used is in web2py here https://github.com/web2py/web2py/blob/master/gluon/authapi.py#L447, which uses this getter https://github.com/web2py/web2py/blob/master/gluon/authapi.py#L180 to look up the table in db. So to change that to s3db, we'd need to override that getter in the AuthS3 class?

hallamoore added a commit to hallamoore/eden that referenced this issue Dec 5, 2019
Fixes sahana#1525

This prevents the `auth_event` table from being loaded on every request.
The `table_event` getter in web2py tries looking for the table in `db`,
so I also had to override that getter on the AuthS3 class to look in
`s3db` instead.
@hallamoore hallamoore linked a pull request Dec 5, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants