mirror of
https://github.com/jazzband/django-ddp.git
synced 2026-05-12 09:33:15 +00:00
Bugfix thread locals setup when opening WebSocket.
This commit is contained in:
parent
0bbf5ac10c
commit
91a1b4a3db
1 changed files with 6 additions and 6 deletions
|
|
@ -115,6 +115,12 @@ class DDPWebSocketApplication(geventwebsocket.WebSocketApplication):
|
|||
|
||||
def on_open(self):
|
||||
"""Handle new websocket connection."""
|
||||
this.request = WSGIRequest(self.ws.environ)
|
||||
this.ws = self
|
||||
this.send = self.send
|
||||
this.reply = self.reply
|
||||
this.error = self.error
|
||||
|
||||
self.logger = self.ws.logger
|
||||
self.remote_ids = collections.defaultdict(set)
|
||||
|
||||
|
|
@ -325,12 +331,6 @@ class DDPWebSocketApplication(geventwebsocket.WebSocketApplication):
|
|||
elif version not in support:
|
||||
self.error('Client version/support mismatch.')
|
||||
else:
|
||||
this.request = WSGIRequest(self.ws.environ)
|
||||
this.ws = self
|
||||
this.send = self.send
|
||||
this.reply = self.reply
|
||||
this.error = self.error
|
||||
|
||||
from dddp.models import Connection
|
||||
cur = connection.cursor()
|
||||
cur.execute('SELECT pg_backend_pid()')
|
||||
|
|
|
|||
Loading…
Reference in a new issue