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] If getting usage-based notifications fails, log a warning instead of propagating the error to the dashboard #13178

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/server/ee/src/workspace/gitpod-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
const result = await super.getNotifications(ctx);
const user = this.checkAndBlockUser("getNotifications");

try {
const billingMode = await this.billingModes.getBillingModeForUser(user, new Date());
if (billingMode.mode === "usage-based") {
const limit = await this.billingService.checkUsageLimitReached(user);
Expand All @@ -2303,6 +2304,10 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
result.unshift("The usage limit is almost reached.");
}
}
} catch (error) {
log.warn({ userId: user.id }, "Could not get usage-based notifications for user", { error });
}

return result;
}

Expand Down