6 Commits

Author SHA1 Message Date
Guewen Baconnier
6303714df5 Use a Reconnecting TCP Client Protocol
Source is https://stackoverflow.com/a/49452683/1504003
with small adaptations (reset delay and retries when we get back a
connection)

Instead of creating the connection in the "main" method, loop and reopen
a new event loop on failures, let the Protocol class handle connections
and retries on failures.

Reduce keepalive interval and store values in attributes. As many
timeouts in systems are 60 seconds, a keepalive of 50 seconds is less
likely to be stopped.

Improve logs: the docstring of connection_lost is:

      The argument is either an exception object or None. The latter means a
      regular EOF is received, or the connection was aborted or closed by this
      side of the connection.

When it receives no exception, it should not raise an error log.
2021-11-22 20:19:53 +07:00
Alexandre Fayolle
d4ef72c150 [FIX] stock_vertical_lift_kardex proxy
The proxy would not exit properly in case of a lost connection with the JMIF server.
The change allows the proxy to exit, giving a chance to an external monitoring system
to restart the service.
2021-11-22 19:47:16 +07:00
Simone Orsi
125f8139bd stock_vertical_lift_kardex: make pre-commit happy 2021-11-22 19:47:16 +07:00
Guewen Baconnier
355d19f7a6 Add +x on kardex-proxy.py script 2021-09-20 14:41:57 +07:00
Guewen Baconnier
f27c4d0de5 [IMP] stock_vertical_lift: black, isort 2021-09-20 14:41:57 +07:00
Alexandre Fayolle
ebcd872bb9 [IMP] add a proxy to communicate with the kardex server 2021-09-20 14:41:57 +07:00