From a3b04e433f9a9370052172988b584d6590265f71 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Mon, 15 Jul 2024 13:53:54 +0200 Subject: [PATCH] [server] allow configure timeouts via featureflag (#20035) --- components/server/src/billing/entitlement-service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/server/src/billing/entitlement-service.ts b/components/server/src/billing/entitlement-service.ts index 5e2ca7229d82ca..1981c54cdcace1 100644 --- a/components/server/src/billing/entitlement-service.ts +++ b/components/server/src/billing/entitlement-service.ts @@ -17,6 +17,7 @@ import { inject, injectable } from "inversify"; import { BillingModes } from "./billing-mode"; import { EntitlementServiceUBP } from "./entitlement-service-ubp"; import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; +import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server"; export interface MayStartWorkspaceResult { hitParallelWorkspaceLimit?: HitParallelWorkspaceLimit; @@ -124,8 +125,14 @@ export class EntitlementServiceImpl implements EntitlementService { const billingMode = await this.billingModes.getBillingMode(userId, organizationId); switch (billingMode.mode) { case "none": - // when payment is disabled users can do everything - return true; + const disable_set_timeout = await getExperimentsClientForBackend().getValueAsync( + "disable_set_timeout", + false, + { + gitpodHost: process.env.GITPOD_HOST, + }, + ); + return !disable_set_timeout; case "usage-based": return this.ubp.maySetTimeout(userId, organizationId); }