dynasticorpheus / gigasetelements-cli

Gigaset Elements - python based command line interface
GNU General Public License v2.0
35 stars 11 forks source link

python takes 100% cpu when no internet connection #27

Closed niziak closed 6 years ago

niziak commented 6 years ago

When Internet connection is lost script takes 100% CPU flooding log files with: Version: laster master

[Wed Jun 13 17:38:14 2018] Gigaset Elements - Command-line Interface
[Wed Jun 13 17:38:15 2018] Configuration     | LOADED   | /home/domoticz/.gigasetelements-cli/gigasetelements-cli.conf
[Wed Jun 13 17:38:15 2018] ERROR             | UNKNOWN  | 06/13/18 17:38:15 HTTPSConnectionPool(host='im.gigaset-elements.de', port=443): Max retries exceeded with url: /identity/api/v1/user/login (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffa8fc21a10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
[Wed Jun 13 17:38:15 2018] Gigaset Elements - Command-line Interface
[Wed Jun 13 17:38:15 2018] Configuration     | LOADED   | /home/domoticz/.gigasetelements-cli/gigasetelements-cli.conf
[Wed Jun 13 17:38:15 2018] ERROR             | UNKNOWN  | 06/13/18 17:38:15 HTTPSConnectionPool(host='im.gigaset-elements.de', port=443): Max retries exceeded with url: /identity/api/v1/user/login (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7efcfe0a9a10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
[Wed Jun 13 17:38:15 2018] Gigaset Elements - Command-line Interface
[Wed Jun 13 17:38:15 2018] Configuration     | LOADED   | /home/domoticz/.gigasetelements-cli/gigasetelements-cli.conf
[Wed Jun 13 17:38:15 2018] ERROR             | UNKNOWN  | 06/13/18 17:38:15 HTTPSConnectionPool(host='im.gigaset-elements.de', port=443): Max retries exceeded with url: /identity/api/v1/user/login (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7effce421a10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
[Wed Jun 13 17:38:15 2018] Gigaset Elements - Command-line Interface
[Wed Jun 13 17:38:15 2018] Configuration     | LOADED   | /home/domoticz/.gigasetelements-cli/gigasetelements-cli.conf
[Wed Jun 13 17:38:15 2018] ERROR             | UNKNOWN  | 06/13/18 17:38:15 HTTPSConnectionPool(host='im.gigaset-elements.de', port=443): Max retries exceeded with url: /identity/api/v1/user/login (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4c13e31a10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
[Wed Jun 13 17:38:15 2018] Gigaset Elements - Command-line Interface
dynasticorpheus commented 6 years ago

@niziak I have added a 6 second delay to the --restart option.

dynasticorpheus commented 6 years ago

@niziak Decided to make delay duration configurable through a command-line option 8b437cb