Skip to content

Commit 20bf161

Browse files
committed
remove the switch for spending limit check
1 parent cd36ddd commit 20bf161

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

components/server/ee/src/billing/billing-service.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import { CostCenterDB } from "@gitpod/gitpod-db/lib";
88
import { User } from "@gitpod/gitpod-protocol";
99
import { AttributionId } from "@gitpod/gitpod-protocol/lib/attribution";
10-
import { ConfigCatClientFactory } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server";
1110
import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
1211
import { GetUpcomingInvoiceResponse } from "@gitpod/usage-api/lib/usage/v1/billing_pb";
1312
import {
@@ -31,7 +30,6 @@ export class BillingService {
3130
protected readonly usageServiceClientProvider: CachingUsageServiceClientProvider;
3231
@inject(CachingBillingServiceClientProvider)
3332
protected readonly billingServiceClientProvider: CachingBillingServiceClientProvider;
34-
@inject(ConfigCatClientFactory) protected readonly configCatClientFactory: ConfigCatClientFactory;
3533

3634
async checkSpendingLimitReached(user: User): Promise<SpendingLimitReachedResult> {
3735
const attributionId = await this.userService.getWorkspaceUsageAttributionId(user);
@@ -46,13 +44,6 @@ export class BillingService {
4644
};
4745
}
4846

49-
if (!(await this.isSpendingLimitCheckEnabled(user))) {
50-
return {
51-
reached: false,
52-
attributionId,
53-
};
54-
}
55-
5647
const upcomingInvoice = await this.getUpcomingInvoice(attributionId);
5748
const currentUsage = upcomingInvoice.getCredits();
5849
if (currentUsage >= costCenter.spendingLimit) {
@@ -84,13 +75,6 @@ export class BillingService {
8475
};
8576
}
8677

87-
protected async isSpendingLimitCheckEnabled(user: User): Promise<boolean> {
88-
// introducing this enablement flag to be able to explicitly control the spending limit check during rollout
89-
return await this.configCatClientFactory().getValueAsync("isSpendingLimitCheckEnabled", false, {
90-
user: user,
91-
});
92-
}
93-
9478
async getUpcomingInvoice(attributionId: AttributionId): Promise<GetUpcomingInvoiceResponse> {
9579
const response = await this.billingServiceClientProvider.getDefault().getUpcomingInvoice(attributionId);
9680
return response;

0 commit comments

Comments
 (0)