mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 11:42:30 +03:00
UBERF-7865: Fix wrong access to not created collection (#6315)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
e4ed3bd8af
commit
d9640ccaa0
@ -62,6 +62,8 @@ services:
|
||||
- LAST_NAME_FIRST=true
|
||||
- ACCOUNTS_URL=http://localhost:3000
|
||||
- BRANDING_PATH=/var/cfg/branding.json
|
||||
- INIT_SCRIPT_URL=https://raw.githubusercontent.com/hcengineering/init/main/script.yaml
|
||||
- INIT_WORKSPACE=onboarding
|
||||
restart: unless-stopped
|
||||
collaborator:
|
||||
image: hardcoreeng/collaborator
|
||||
|
@ -16,7 +16,7 @@ const disabled = (process.env.MODEL_DISABLED ?? '').split(',').map((it) => it.tr
|
||||
const txes = JSON.parse(JSON.stringify(builder(enabled, disabled).getTxes())) as Tx[]
|
||||
|
||||
configureAnalytics(process.env.SENTRY_DSN, {})
|
||||
Analytics.setTag('application', 'transactor')
|
||||
Analytics.setTag('application', 'account')
|
||||
|
||||
const metricsContext = new MeasureMetricsContext(
|
||||
'account',
|
||||
|
@ -174,6 +174,7 @@ export class DomainIndexHelperImpl implements DomainHelper {
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
ctx.error('error during domain collections/indexes check', { domain, error: err })
|
||||
Analytics.handleError(err)
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,10 @@ export class DBCollectionHelper implements DomainHelperOperations {
|
||||
}
|
||||
|
||||
async estimatedCount (domain: Domain): Promise<number> {
|
||||
const c = this.collection(domain)
|
||||
return await c.estimatedDocumentCount()
|
||||
if (this.exists(domain)) {
|
||||
const c = this.collection(domain)
|
||||
return await c.estimatedDocumentCount()
|
||||
}
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user