Skip to content

Commit

Permalink
fix(server): update resource price to 0 in initializer (#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow authored May 30, 2023
1 parent ca634a6 commit 9a2281e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions server/src/application/application.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class ApplicationController {
// check account balance
const account = await this.account.findOne(user._id)
const balance = account?.balance || 0
if (!isTrialTier && balance <= 0) {
if (!isTrialTier && balance < 0) {
return ResponseUtil.error(`account balance is not enough`)
}

Expand Down Expand Up @@ -221,7 +221,7 @@ export class ApplicationController {
// check account balance
const account = await this.account.findOne(user._id)
const balance = account?.balance || 0
if (balance <= 0) {
if (balance < 0) {
return ResponseUtil.error(`account balance is not enough`)
}

Expand Down
10 changes: 5 additions & 5 deletions server/src/initializer/initializer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class InitializerService {
{
regionId: region._id,
type: ResourceType.CPU,
price: 0.000072,
price: 0.0,
specs: [
{ label: '0.2 Core', value: 200 },
{ label: '0.5 Core', value: 500 },
Expand All @@ -180,7 +180,7 @@ export class InitializerService {
{
regionId: region._id,
type: ResourceType.Memory,
price: 0.000036,
price: 0.0,
specs: [
{ label: '256 MB', value: 256 },
{ label: '512 MB', value: 512 },
Expand All @@ -194,7 +194,7 @@ export class InitializerService {
{
regionId: region._id,
type: ResourceType.DatabaseCapacity,
price: 0.0000072,
price: 0.0,
specs: [
{ label: '1 GB', value: 1024 },
{ label: '4 GB', value: 4096 },
Expand All @@ -208,7 +208,7 @@ export class InitializerService {
{
regionId: region._id,
type: ResourceType.StorageCapacity,
price: 0.000002,
price: 0.0,
specs: [
{ label: '1 GB', value: 1024 },
{ label: '4 GB', value: 4096 },
Expand Down Expand Up @@ -261,7 +261,7 @@ export class InitializerService {
[ResourceType.NetworkTraffic]: { value: 0 },
},
enableFreeTier: true,
limitCountOfFreeTierPerUser: 1,
limitCountOfFreeTierPerUser: 20,
createdAt: new Date(),
updatedAt: new Date(),
},
Expand Down

0 comments on commit 9a2281e

Please sign in to comment.