mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 09:53:02 -04:00
Refactor
This commit is contained in:
@@ -32,10 +32,10 @@ def find_apps():
|
|||||||
|
|
||||||
|
|
||||||
def is_available(url):
|
def is_available(url):
|
||||||
host, port = url.split("/")[2].split(":")
|
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.settimeout(1)
|
s.settimeout(1)
|
||||||
try:
|
try:
|
||||||
|
host, port = url.split("/")[2].split(":")
|
||||||
s.connect((host, int(port)))
|
s.connect((host, int(port)))
|
||||||
s.shutdown(socket.SHUT_RDWR)
|
s.shutdown(socket.SHUT_RDWR)
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user