File tree Expand file tree Collapse file tree 1 file changed +10
-24
lines changed Expand file tree Collapse file tree 1 file changed +10
-24
lines changed Original file line number Diff line number Diff line change @@ -172,32 +172,18 @@ def connect_direct(
172
172
q = queue .SimpleQueue ()
173
173
uri_with_protocol = f"{ uri } /{ PROTOCOL_VERSION } "
174
174
175
- def create_ws_connection ():
176
- try :
177
- logging .info ("Connecting to SQL session at %s ..." , uri_with_protocol )
178
- ws = websockets .sync .client .connect (
179
- uri = uri_with_protocol ,
180
- additional_headers = headers ,
181
- max_size = MAX_MESSAGE_SIZE ,
182
- )
183
- q .put (ws )
184
- except Exception as e :
185
- q .put (e )
186
-
187
- dt = threading .Thread (
188
- name = "wherobots-ws-connector" ,
189
- target = create_ws_connection ,
190
- daemon = True ,
191
- )
192
- dt .start ()
193
- dt .join ()
194
-
195
- result = q .get ()
196
- if isinstance (result , Exception ):
197
- raise InterfaceError ("Failed to connect to SQL session!" ) from result
175
+ try :
176
+ logging .info ("Connecting to SQL session at %s ..." , uri_with_protocol )
177
+ ws = websockets .sync .client .connect (
178
+ uri = uri_with_protocol ,
179
+ additional_headers = headers ,
180
+ max_size = MAX_MESSAGE_SIZE ,
181
+ )
182
+ except Exception as e :
183
+ raise InterfaceError ("Failed to connect to SQL session!" ) from e
198
184
199
185
return Connection (
200
- result ,
186
+ ws ,
201
187
read_timeout = read_timeout ,
202
188
results_format = results_format ,
203
189
data_compression = data_compression ,
You can’t perform that action at this time.
0 commit comments