def run(self):
        while self.alive:
            if not is_authentication_set():
                gui.notify_warn('Authentication not set',
                                'You need to enter credentials')
            elif not user.logged:
                if not api.login(
                        username=qobuzApp.registry.get('username'),
                        password=qobuzApp.registry.get('password')):
                    gui.notify_warn('Login failed', 'Invalid credentials')
                else:
                    try:
                        application.run(port=self.port,
                                        threaded=True,
                                        processes=0,
                                        debug=False,
                                        use_reloader=False,
                                        use_debugger=False,
                                        use_evalex=True,
                                        passthrough_errors=False)
                    except Exception as e:
                        logger.error('KooliService port: %s Error: %s',
                                     self.port, e)
                        raise e
            time.sleep(1)