[202012] [Mellanox] Fix select timeout in sfp event (#13347)

- Why I did it
Backport #9795
Python select.select accept a optional timeout value in seconds, however, the value passes to it is a value in millisecond.

- How I did it
Transfer the value to millisecond.

- How to verify it
Manual test
This commit is contained in:
Junchao-Mellanox 2023-01-19 23:29:41 +08:00 committed by GitHub
parent 21ad9876a3
commit 46a774e294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,7 +217,7 @@ class sfp_event:
found = 0
try:
read, _, _ = select.select([self.rx_fd_p.fd], [], [], timeout)
read, _, _ = select.select([self.rx_fd_p.fd], [], [], float(timeout) / 1000)
except select.error as err:
rc, msg = err
if rc == errno.EAGAIN or rc == errno.EINTR: