Skip to content

Commit

Permalink
try to ignore pytype failure
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Dec 11, 2024
1 parent cca47b7 commit 8583eae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions truenas_api_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,11 @@ def set_socket_options(socobj):
# 3. for a maximum up to 5 times
#
# after 5 times (5 seconds of no response), the socket will be closed
# pytype: disable=attribute-error
if plat in ('linux', 'freebsd', 'win32'):
socobj.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 1)
socobj.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 1) # pytype: disable=attribute-error

else:
socobj.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPALIVE, 1)
# pytype: enable=attribute-error
socobj.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPALIVE, 1) # pytype: disable=attribute-error

socobj.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 1)
socobj.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 5)

0 comments on commit 8583eae

Please sign in to comment.