Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] Fix timeouts for SAAS #4819

Merged
merged 1 commit into from
Jul 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions components/server/ee/src/user/user-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@ import { LicenseEvaluator } from "@gitpod/licensor/lib";
import { Feature } from "@gitpod/licensor/lib/api";
import { AuthException } from "../../../src/auth/errors";
import { EligibilityService } from "./eligibility-service";
import { EnvEE } from "../env";

export class UserServiceEE extends UserService {
@inject(EnvEE) protected readonly env: EnvEE;
@inject(LicenseEvaluator) protected readonly licenseEvaluator: LicenseEvaluator;
@inject(EligibilityService) protected readonly eligibilityService: EligibilityService;

async getDefaultWorkspaceTimeout(user: User, date: Date): Promise<WorkspaceTimeoutDuration> {
// todo@at: how to select the timeout for SaaS?
// return this.eligibilityService.getDefaultWorkspaceTimeout(user, date);

if (this.env.enablePayment) {
// the SAAS case
return this.eligibilityService.getDefaultWorkspaceTimeout(user, date);
}

// the self-hosted case
if (!this.licenseEvaluator.isEnabled(Feature.FeatureSetTimeout)) {
return "30m";
}
Expand Down