'Starts a thread which requests from the server every second, so
we know if the connection is still alive.'

def continously_check_server_connection(self):

    def test_server_connection():
        tolerance = 0
        while True:
            time.sleep(1)
            test_was_successful = (self.server_info() is not None)
            if test_was_successful:
                tolerance = 0
            else:
                tolerance += 1
                if (tolerance == 3):
                    notification_center.CouchDBConnectionProblem()
    test_server_thread = threading.Thread(target=test_server_connection)
    test_server_thread.daemon = True
    test_server_thread.start()
