def _on_server_start(server):
    _maybe_print_old_git_warning(server.script_path)
    _print_url(server.is_running_hello)
    report_watchdog_availability()
    _print_new_version_message()
    try:
        secrets.load_if_toml_exists()
    except BaseException as e:
        LOGGER.error(f'Failed to load {SECRETS_FILE_LOC}', exc_info=e)

    def maybe_open_browser():
        if config.get_option('server.headless'):
            return
        if server.browser_is_connected:
            return
        if config.is_manually_set('browser.serverAddress'):
            addr = config.get_option('browser.serverAddress')
        elif config.is_manually_set('server.address'):
            if server_address_is_unix_socket():
                return
            addr = config.get_option('server.address')
        else:
            addr = 'localhost'
        util.open_browser(Report.get_url(addr))
    ioloop = tornado.ioloop.IOLoop.current()
    ioloop.call_later(BROWSER_WAIT_TIMEOUT_SEC, maybe_open_browser)
def _on_server_start(server):
    _maybe_print_old_git_warning(server.script_path)
    _print_url(server.is_running_hello)
    report_watchdog_availability()
    _print_new_version_message()
    try:
        secrets.load_if_toml_exists()
    except BaseException as e:
        LOGGER.error(f'Failed to load {SECRETS_FILE_LOC}', exc_info=e)

    def maybe_open_browser():
        if config.get_option('server.headless'):
            return
        if server.browser_is_connected:
            return
        if config.is_manually_set('browser.serverAddress'):
            addr = config.get_option('browser.serverAddress')
        elif config.is_manually_set('server.address'):
            if server_address_is_unix_socket():
                return
            addr = config.get_option('server.address')
        else:
            addr = 'localhost'
        util.open_browser(Report.get_url(addr))
    ioloop = tornado.ioloop.IOLoop.current()
    ioloop.call_later(BROWSER_WAIT_TIMEOUT_SEC, maybe_open_browser)