Skip to content
This repository has been archived by the owner on Jan 17, 2021. It is now read-only.

Commit

Permalink
fix lost ip quickly when network not available #49
Browse files Browse the repository at this point in the history
  • Loading branch information
xyuanmu committed Apr 15, 2016
1 parent 461e054 commit f01b7de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pythonlib/local/check_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def connect_ssl(ip, port=443, timeout=5, openssl_context=None, check_cert=True):
time_handshaked = time.time()

# report network ok
check_local_network.network_stat = "OK"
check_local_network.last_check_time = time_handshaked
check_local_network.continue_fail_count = 0
#check_local_network.network_stat = "OK"
#check_local_network.last_check_time = time_handshaked
#check_local_network.continue_fail_count = 0

cert = ssl_sock.get_peer_certificate()
if not cert:
Expand Down
2 changes: 1 addition & 1 deletion pythonlib/local/check_local_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _simple_check_worker():
xlog.debug("network is ok, cost:%d ms", 1000*(time.time() - time_now))
return True
except Exception as e:
xlog.exception("simple check network fail:%r", e)
xlog.warn("simple check network fail:%r", e)
network_stat = "Fail"
last_check_time = time.time()
return False
Expand Down

0 comments on commit f01b7de

Please sign in to comment.