Skip to content

Commit c5ac861

Browse files
committed
[server] Enable connection limiting for free tier
1 parent d9f460b commit c5ac861

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

components/gitpod-protocol/src/protocol.ts

+1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ export const WorkspaceFeatureFlags = {
295295
persistent_volume_claim: undefined,
296296
protected_secrets: undefined,
297297
workspace_class_limiting: undefined,
298+
workspace_connection_limiting: undefined,
298299
};
299300
export type NamedWorkspaceFeatureFlag = keyof typeof WorkspaceFeatureFlags;
300301

components/server/src/workspace/workspace-starter.ts

+15
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,21 @@ export class WorkspaceStarter {
859859
}
860860
}
861861

862+
const wsConnectionLimitingEnabled = await getExperimentsClientForBackend().getValueAsync(
863+
"workspace_connection_limiting",
864+
false,
865+
{ user },
866+
);
867+
if (wsConnectionLimitingEnabled) {
868+
const shouldLimitNetworkConnections = await this.entitlementService.limitNetworkConnections(
869+
user,
870+
new Date(),
871+
);
872+
if (shouldLimitNetworkConnections) {
873+
featureFlags = featureFlags.concat(["workspace_connection_limiting"]);
874+
}
875+
}
876+
862877
let workspaceClass = "";
863878
const userTeams = await this.teamDB.findTeamsByUser(user.id);
864879
let classesEnabled = await getExperimentsClientForBackend().getValueAsync("workspace_classes", false, {

0 commit comments

Comments
 (0)