On Tuesday, April 3, 2018 at 8:43:31 AM UTC-4, Lisandro wrote: > > I store the sessions in the database, so there is no problem with a locked > file. > > I've just found something interesting that could help to figure out: when > the problem presents, I checked the pg_stat_activity in postgres to see if > there was a long running query, and there is indeed. But the query is a > simple select to the auth_user table, to select the row of the logged in > user. How can this query take that long? Does web2py lock the user row? If > so, how do I release it? > > Something to consider: in my db.py, at the end, I do this: > > response.user = db.auth_user[auth.user.id] if auth.is_logged_in() else > None >
FYI, auth.user is the user's record from db.auth_user (minus the password field and the update_record and delete_record attributes), so depending on what you are doing with response.user, you might be able to replace the above with: response.user = auth.user Or just use auth.user directly in your code. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

