forked from extern/easydiffusion
Return empty list if hostname lookup fails
This commit is contained in:
parent
cdfef16a0e
commit
57efe31959
@ -314,9 +314,15 @@ def getUIPlugins():
|
|||||||
return plugins
|
return plugins
|
||||||
|
|
||||||
def getIPConfig():
|
def getIPConfig():
|
||||||
|
try:
|
||||||
ips = socket.gethostbyname_ex(socket.gethostname())
|
ips = socket.gethostbyname_ex(socket.gethostname())
|
||||||
ips[2].append(ips[0])
|
ips[2].append(ips[0])
|
||||||
return ips[2]
|
return ips[2]
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
print(traceback.format_exc())
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
@app.get('/get/{key:path}')
|
@app.get('/get/{key:path}')
|
||||||
def read_web_data(key:str=None):
|
def read_web_data(key:str=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user