You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just learning about threading and I hope someone will answer this for me: Why is PGThread class neccesary? What is exactly doing?
It's strange because as I understand Django connections are implemented as thread locals, so schema, tenant could be set on the connection itself, no?
The text was updated successfully, but these errors were encountered:
I've been looking at django's code and at my code the last 45 minutes and can't think of any good reason. I even found the commit where I added this class e8e395a. To be honest I have no recollection of why this was needed. The comment on the class also doesn't make much sense "This is a bad monkey patching resulting from the fact that we can't separate public from shared apps right now. issue #1 on github". Maybe at that time I didn't know I could have used the connections as thread locals?
I'm always in favor of refactoring code that doesn't make sense. Do you want to send a patch?
https://github.com/bernardopires/django-tenant-schemas/blob/master/tenant_schemas/postgresql_backend/base.py#L22
I'm just learning about threading and I hope someone will answer this for me: Why is PGThread class neccesary? What is exactly doing?
It's strange because as I understand Django connections are implemented as thread locals, so schema, tenant could be set on the connection itself, no?
The text was updated successfully, but these errors were encountered: