@@ -94,8 +94,7 @@ def __init__(self) -> None:
9494 self .server = None
9595 self .failed_filelist = FileList (files = [])
9696 self .enabled = False
97- self .https_site = None
98- self .http_site = None
97+ self .site = None
9998
10099 async def fetchFileList (self ) -> None :
101100 logger .tinfo ("cluster.info.filelist.fetching" )
@@ -259,15 +258,10 @@ async def listen(self, https: bool, port: int) -> None:
259258 ssl_context .check_hostname = False
260259 self .server = web .AppRunner (self .application )
261260 await self .server .setup ()
262- if https :
263- self .https_site = web .TCPSite (
264- self .server , "0.0.0.0" , port , ssl_context = ssl_context
265- )
266- await self .https_site .start ()
267- self .http_site = web .TCPSite (
268- self .server , "0.0.0.0" , port
261+ self .site = web .TCPSite (
262+ self .server , "0.0.0.0" , port , ssl_context = ssl_context
269263 )
270- await self .http_site .start ()
264+ await self .site .start ()
271265 logger .tsuccess ("cluster.success.listen" , port = port )
272266 except Exception as e :
273267 logger .terror ("cluster.error.listen" , e = e )
@@ -290,7 +284,7 @@ async def callback(data: List[Any]):
290284 "enable" ,
291285 data = {
292286 "host" : Config .get ("cluster.host" ),
293- "port" : Config .get ("cluster.public_port" ) or Config .get ("cluster.port" ),
287+ "port" : Config .get ("cluster.public_port" ) if Config . get ( "cluster.public_port" ) is not - 1 else Config .get ("cluster.port" ),
294288 "version" : API_VERSION ,
295289 "byoc" : Config .get ("cluster.byoc" ),
296290 "noFastEnable" : True ,
0 commit comments