Open treitmayr opened 8 months ago
Ankerctl does health check connections to the printer as it is an "always on" service. If the service is running, it is communicating to the printer to maintain connection so that when you load the website, it is ready.
Bug Description When the ankerctl web server runs, the printer is not available, and at least one browser is connected to ankerctl, the server tries to contact the printer coninuously, as would be expected so that the PPPP badge can be updated. However, when the browser (tab) is closed, the server still tries to contact the printer via PPPP. When started as a docker service, this will result in constant write accesses to the log file.
Note: This bug is not related to the number of bugs concerning unsuccessful PPPP connections!
To Reproduce Steps to reproduce the behavior:
Trying connect to printer AnkerMake M5C (EUPRAKM-013657-LNCZN) over pppp using ip <IP>
Expected Behavior As soon as there is no websocket connection from any web browser to the PPPP websocket endpoint anymore, ankerctl should stop trying to contact the printer via PPPP.
Additional Context This issue can be observed using the master branch as well as the modified version of PR #145 and anselor:exiles.
Initial Analysis The PPPP service is implemented in a way that it is only "started" when the PPPP could be established. The
ServiceManager.borrow()
andServiceManager.stream()
functions called by the websocket endpoint both try to start the PPPP service without employing any timeout meachanism. Furthermore (and possibly only relevant for the PR #145 version), the PPPP websocket endpoint should check if the websocket connection is still alive inside its loop.