{"action":"created","issue":{"url":"https://api.github.com/repos/isandlaTech/cohorte-herald/issues/13","labels_url":"https://api.github.com/repos/isandlaTech/cohorte-herald/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/isandlaTech/cohorte-herald/issues/13/comments","events_url":"https://api.github.com/repos/isandlaTech/cohorte-herald/issues/13/events","html_url":"https://github.com/isandlaTech/cohorte-herald/issues/13","id":69624097,"number":13,"title":"Check/recheck connection to XMPP server","user":{"login":"debbabi","id":522491,"avatar_url":"https://avatars.githubusercontent.com/u/522491?v=3","gravatar_id":"","url":"https://api.github.com/users/debbabi","html_url":"https://github.com/debbabi","followers_url":"https://api.github.com/users/debbabi/followers","following_url":"https://api.github.com/users/debbabi/following{/other_user}","gists_url":"https://api.github.com/users/debbabi/gists{/gist_id}","starred_url":"https://api.github.com/users/debbabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debbabi/subscriptions","organizations_url":"https://api.github.com/users/debbabi/orgs","repos_url":"https://api.github.com/users/debbabi/repos","events_url":"https://api.github.com/users/debbabi/events{/privacy}","received_events_url":"https://api.github.com/users/debbabi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/isandlaTech/cohorte-herald/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-20T16:20:23Z","updated_at":"2015-04-22T07:58:07Z","closed_at":null,"body":"Line: 162\r\nhttps://github.com/isandlaTech/cohorte-herald/blob/master/python/herald/transports/xmpp/transport.py#L162\r\n\r\nFix by something like that one:\r\n```python\r\n        # Connect to the server\r\n        from time import sleep\r\n        tries_delay = 5\r\n        max_tries = 3\r\n        tries = range(max_tries)\r\n        connected = False\r\n        for tries_remaining in tries:\r\n            if self._bot.connect(self._host, self._port):\r\n                connected = True\r\n                break\r\n            else:\r\n                sleep(tries_delay)\r\n        if connected == False:\r\n        # if not self._bot.connect(self._host, self._port):\r\n            _logger.error(\"Can't connect to the XMPP server at %s port %s\",\r\n                          self._host, self._port)\r\n```"},"comment":{"url":"https://api.github.com/repos/isandlaTech/cohorte-herald/issues/comments/95067373","html_url":"https://github.com/isandlaTech/cohorte-herald/issues/13#issuecomment-95067373","issue_url":"https://api.github.com/repos/isandlaTech/cohorte-herald/issues/13","id":95067373,"user":{"login":"tcalmant","id":1540582,"avatar_url":"https://avatars.githubusercontent.com/u/1540582?v=3","gravatar_id":"","url":"https://api.github.com/users/tcalmant","html_url":"https://github.com/tcalmant","followers_url":"https://api.github.com/users/tcalmant/followers","following_url":"https://api.github.com/users/tcalmant/following{/other_user}","gists_url":"https://api.github.com/users/tcalmant/gists{/gist_id}","starred_url":"https://api.github.com/users/tcalmant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcalmant/subscriptions","organizations_url":"https://api.github.com/users/tcalmant/orgs","repos_url":"https://api.github.com/users/tcalmant/repos","events_url":"https://api.github.com/users/tcalmant/events{/privacy}","received_events_url":"https://api.github.com/users/tcalmant/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T07:58:07Z","updated_at":"2015-04-22T07:58:07Z","body":"Looking at the [Event Index](https://github.com/fritzy/SleekXMPP/wiki/Event-Index) of [SleekXMPP](https://github.com/fritzy/SleekXMPP), the following ones could give hints about connection failures:\r\n* *disconnected*, regarding if the session ended before receiving this event\r\n* *connection_failed*, from [xmlstream.py@782](https://github.com/fritzy/SleekXMPP/blob/develop/sleekxmpp/xmlstream/xmlstream.py#L782)\r\n"}}