mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-12 23:36:46 +00:00
Make timeout for check configurable.
This commit is contained in:
parent
ab18cc66c5
commit
0fcb008232
@ -16,6 +16,7 @@ fc.mode = fc.MODE_FULL
|
|||||||
# CLTP = 10 (only show actual updates or HTTP 206) / 2010 (always show latest version for MODE_FULL)
|
# CLTP = 10 (only show actual updates or HTTP 206) / 2010 (always show latest version for MODE_FULL)
|
||||||
#fc.cltp = 10
|
#fc.cltp = 10
|
||||||
fc.cltp = 2010
|
fc.cltp = 2010
|
||||||
|
fc.timeout = 20
|
||||||
|
|
||||||
print("List of latest FULL firmware by PRD:")
|
print("List of latest FULL firmware by PRD:")
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ fc.serid = "3531510"
|
|||||||
#fc.osvs = "7.1.1"
|
#fc.osvs = "7.1.1"
|
||||||
fc.mode = fc.MODE_OTA
|
fc.mode = fc.MODE_OTA
|
||||||
fc.cltp = 10
|
fc.cltp = 10
|
||||||
|
fc.timeout = 20
|
||||||
|
|
||||||
force_ver = False
|
force_ver = False
|
||||||
force_ver_text = ""
|
force_ver_text = ""
|
||||||
|
@ -55,6 +55,7 @@ class FotaCheck:
|
|||||||
self.cktp = self.CKTP_CHECKMANUAL
|
self.cktp = self.CKTP_CHECKMANUAL
|
||||||
self.rtd = self.RTD_UNROOTED
|
self.rtd = self.RTD_UNROOTED
|
||||||
self.chnl = self.CHNL_WIFI
|
self.chnl = self.CHNL_WIFI
|
||||||
|
self.timeout = 10
|
||||||
self.reset_session()
|
self.reset_session()
|
||||||
|
|
||||||
def reset_session(self):
|
def reset_session(self):
|
||||||
@ -99,7 +100,7 @@ class FotaCheck:
|
|||||||
params["chnl"] = self.chnl
|
params["chnl"] = self.chnl
|
||||||
#params["osvs"] = self.osvs
|
#params["osvs"] = self.osvs
|
||||||
|
|
||||||
req = self.sess.get(url, params=params, timeout=10)
|
req = self.sess.get(url, params=params, timeout=self.timeout)
|
||||||
if req.status_code == 200:
|
if req.status_code == 200:
|
||||||
return req.text
|
return req.text
|
||||||
elif req.status_code == 204:
|
elif req.status_code == 204:
|
||||||
|
Loading…
Reference in New Issue
Block a user