Skip to content

Commit

Permalink
fix: archipelago users count (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoArregui authored May 30, 2023
1 parent 6c5b24f commit 9417b12
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"license": "Apache-2.0",
"devDependencies": {
"@dcl/eslint-config": "^1.1.1",
"@dcl/protocol": "^1.0.0-5048370069.commit-00abb1b",
"@types/lodash": "^4.14.191",
"@types/node": "^18.11.18",
"@well-known-components/test-helpers": "^1.4.0",
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/handlers/about-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const networkIds: Record<string, number> = {
export type ArchipelagoStatus = {
version: string
commitHash: string
usersCount: number
userCount: number
}

export type DefaultStatus = Omit<ArchipelagoStatus, 'userCount'>
Expand Down Expand Up @@ -73,7 +73,7 @@ export async function aboutHandler(
])

const healthy = archipelagoStatus.healthy && contentStatus.healthy && lambdasStatus.healthy
const userCount = archipelagoStatus.data?.usersCount || 0
const userCount = archipelagoStatus.data?.userCount || 0
const acceptingUsers = healthy && !resourcesOverload && (!maxUsers || userCount < maxUsers)

const result = {
Expand Down
6 changes: 3 additions & 3 deletions test/unit/about-controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('about-controller-unit', () => {
case `${defaultConfig.INTERNAL_LAMBDAS_URL}/status`:
return { healthy: true, data: { version: 'lambdas_1', commitHash: 'lambdas_hash' } }
case `${defaultConfig.INTERNAL_ARCHIPELAGO_URL}/status`:
return { healthy: true, data: { version: 'archipelago_1', commitHash: 'archipelago_hash', usersCount: 10 } }
return { healthy: true, data: { version: 'archipelago_1', commitHash: 'archipelago_hash', userCount: 10 } }
case `${defaultConfig.INTERNAL_CONTENT_URL}/status`:
return { healthy: true, data: { version: 'content_1', commitHash: 'content_hash' } }
default:
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('about-controller-unit', () => {
case `${defaultConfig.INTERNAL_LAMBDAS_URL}/status`:
return { healthy: true, data: { version: 'lambdas_1', commitHash: 'lambdas_hash' } }
case `${defaultConfig.INTERNAL_ARCHIPELAGO_URL}/status`:
return { healthy: true, data: { version: 'archipelago_1', commitHash: 'archipelago_hash', usersCount: 10 } }
return { healthy: true, data: { version: 'archipelago_1', commitHash: 'archipelago_hash', userCount: 10 } }
case `${defaultConfig.INTERNAL_CONTENT_URL}/status`:
return { healthy: true, data: { version: 'content_1', commitHash: 'content_hash' } }
default:
Expand Down Expand Up @@ -243,7 +243,7 @@ describe('about-controller-unit', () => {
case `${defaultConfig.INTERNAL_LAMBDAS_URL}/status`:
return { healthy: true, data: { version: 'lambdas_1', commitHash: 'lambdas_hash' } }
case `${defaultConfig.INTERNAL_ARCHIPELAGO_URL}/status`:
return { healthy: true, data: { version: 'archipelago_1', commitHash: 'archipelago_hash', usersCount: 1000 } }
return { healthy: true, data: { version: 'archipelago_1', commitHash: 'archipelago_hash', userCount: 1000 } }
case `${defaultConfig.INTERNAL_CONTENT_URL}/status`:
return { healthy: true, data: { version: 'content_1', commitHash: 'content_hash' } }
default:
Expand Down
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,6 @@
dependencies:
"@dcl/ts-proto" "^1.146.2"

"@dcl/protocol@^1.0.0-5048370069.commit-00abb1b":
version "1.0.0-5048370069.commit-00abb1b"
resolved "https://registry.yarnpkg.com/@dcl/protocol/-/protocol-1.0.0-5048370069.commit-00abb1b.tgz#f5519a8fc05fa4a971b16db9ebdd6b2c33db81bf"
integrity sha512-GMLcidu7pRcBSszBIxIjWmw+b5tYYH8ME7xfLIPnikuNXa8k5KquOwo7HxH927pXtaCi6MqGmxW3TbpzI/DCag==
dependencies:
"@dcl/ts-proto" "^1.146.2"

"@dcl/schemas@^6.4.2":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@dcl/schemas/-/schemas-6.19.0.tgz#42cfe23226782a736e3956ebcbd39ef21e63aeb1"
Expand Down

0 comments on commit 9417b12

Please sign in to comment.