scheduleCleanupInterval(keepAliveTimeoutMs = 30000, intervalMs = 10000) {
    this.keepAlive();

    const ONE_HOUR_SECONDS = 60 * 60;
    const idleTimeoutSeconds =
      parseInt(this.connection.idleTimeoutSeconds, 10) || ONE_HOUR_SECONDS;
    const idleTimeoutMs = idleTimeoutSeconds * 1000;

    this.cleanupInterval = setInterval(() => {
      const now = new Date();
      const sinceLastKeepAliveMs = now - this.getLastKeepAliveAt();
      const sinceLastActivityMs = now - this.getLastActivityAt();

      const keepAliveExceeded = sinceLastKeepAliveMs > keepAliveTimeoutMs;
      const lastActivityExceeded = sinceLastActivityMs > idleTimeoutMs;

      if (keepAliveExceeded || lastActivityExceeded) {
        let msg = '';
        if (keepAliveExceeded) {
          msg += `Connection client keep alive exceeded timeout of ${keepAliveTimeoutMs}`;
        } else {
          msg += `Connection client last activity exceeded timeout of ${idleTimeoutMs}`;
        }
        appLog.debug(
          {
            connectionClientId: this.id,
            connectionName: this.getConnectionName(),
            driver: this.getConnectionDriver(),
            sinceLastKeepAliveMs,
            sinceLastActivityMs,
          },
          msg
        );
        this.disconnect().catch((error) => appLog.error(error));
      }
    }, intervalMs);
  }
Set up a poll to check on keep alive and activity requests
and disconnect if keep alive has not been updated within range of keepAliveTimeoutMs or idleTimeoutSeconds (seconds)
@param {number} [keepAliveTimeoutMs] - max amount of time to allow from keep alive ping before closing
@param {number} [intervalMs] - interval ms to check keep alive time