第 17 章 配置 OpenShift 连接超时

默认情况下,OpenShift 路由配置为超时超过 30 秒的 HTTP 请求。这可能会导致 Business Central 中的会话超时问题,从而导致以下行为:

  • "无法完成您的请求。发生以下异常:(TypeError):Cannot read attributes 'indexOf' of null."
  • "无法完成您的请求。发生以下异常:(TypeError): b is null。
  • 当点击 Business Central 中的 ProjectServer 链接时,会显示空白页面。

所有 Business Central 模板都已包含扩展超时配置。

要在 Business Central OpenShift 路由上配置较长的超时,请在目标路由中添加 haproxy.router.openshift.io/timeout: 60s 注解:

  - kind: Route
    apiVersion: v1
    id: "$APPLICATION_NAME-rhpamcentr-http"
    metadata:
      name: "$APPLICATION_NAME-rhpamcentr"
      labels:
        application: "$APPLICATION_NAME"
      annotations:
        description: Route for Business Central's http service.
        haproxy.router.openshift.io/timeout: 60s
    spec:
      host: "$BUSINESS_CENTRAL_HOSTNAME_HTTP"
      to:
        name: "$APPLICATION_NAME-rhpamcentr"

有关特定于全局路由的超时注解的完整列表,请参阅 OpenShift 文档