Skip to content

Commit e29dddd

Browse files
committed
modify connection bug in stream mode
1 parent ac14af3 commit e29dddd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

kubesys/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
from typing import Union
66
from kubesys.common import getLastIndex, dictToJsonString, jsonStringToBytes, getParams, formatURL
7-
from kubesys.http_request import createRequest
7+
from kubesys.http_request import createRequest,doCreateRequest
88
from kubesys.analyzer import KubernetesAnalyzer
99
import requests
1010
import json
@@ -253,7 +253,7 @@ def watchResourcesBase(self, kind, namespace, handlerFunction, thread_name=None,
253253

254254
@staticmethod
255255
def watching(url, token, config, watchHandler, kwargs):
256-
response=createRequest(url=formatURL(url, getParams(kwargs)), token=token, method="GET", keep_json=False, config=config,stream=True)[0]
256+
response=doCreateRequest(url=formatURL(url, getParams(kwargs)), token=token, method="GET", config=config,stream=True)[0]
257257
for json_bytes in response.iter_lines():
258258
if len(json_bytes) < 1:
259259
continue

kubesys/http_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515

1616
def createRequest(url, token, method="GET", body=None, verify=False,
17-
keep_json=False, config=None,stream=False, **kwargs) -> Union[object, bool, str]:
17+
keep_json=False, config=None, **kwargs) -> Union[object, bool, str]:
1818
response, OK, status_code = doCreateRequest(
19-
formatURL(url, getParams(kwargs)), token, method, body, config,stream)
19+
formatURL(url, getParams(kwargs)), token, method, body, config)
2020

2121
result = response.json()
2222
if keep_json:

0 commit comments

Comments
 (0)