blakev / python-syncthing

Python bindings to the Syncthing REST interface.
MIT License
75 stars 24 forks source link

Stop supresssing ConnectionError's in the events generator #28

Closed zhulik closed 4 years ago

zhulik commented 4 years ago

Hello again ;)

After some experiments with the HASS integration I found out that ConnectionError's must not be swallowed, because in case of missing network connection or a syncthing server being down the generator tries to reconnect in an infinite loop consuming lots of CPU.

Also, I found out that the library produces a lot of noise in logs, so I disabled some logging, the errors are reraised anyway

Thank you!

blakev commented 4 years ago

Done. Again, anything you find just leave issues and comments. Will probably release a v3.0 that targets syncthing >1.0 in the next week or two.

zhulik commented 4 years ago

I think, the project needs proper CI(GitHub actions are awesome), all network calls should be mocked in tests. For global refactoring or rewrite, I'd recommend focusing on aio support and async interface.