Skip to content

Commit

Permalink
[server] allow configure timeouts via featureflag (#20035)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenefftinge authored Jul 15, 2024
1 parent c608482 commit a3b04e4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/server/src/billing/entitlement-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit a3b04e4

Please sign in to comment.