mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
UBERF-7865: Final fix (#6316)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
de06891111
commit
319ce9cafc
@ -579,14 +579,24 @@ function getExtra (info: Account | AccountInfo | null, rec?: Record<string, any>
|
||||
|
||||
export const guestAccountEmail = '#guest@hc.engineering'
|
||||
|
||||
const failedEmails = new Set()
|
||||
|
||||
function decodeToken (ctx: MeasureContext, token: string): Token {
|
||||
// eslint-disable-next-line no-useless-catch
|
||||
try {
|
||||
return decodeTokenRaw(token)
|
||||
} catch (err: any) {
|
||||
try {
|
||||
// Ok we have error, but we need to log a proper message
|
||||
ctx.warn('failed to verify token', { ...decodeTokenRaw(token, false) })
|
||||
const decode = decodeTokenRaw(token, false)
|
||||
const has = failedEmails.has(decode.email)
|
||||
if (!has) {
|
||||
failedEmails.add(decode.email)
|
||||
// Ok we have error, but we need to log a proper message
|
||||
ctx.warn('failed to verify token', { ...decode })
|
||||
}
|
||||
if (failedEmails.size > 1000) {
|
||||
failedEmails.clear()
|
||||
}
|
||||
} catch (err2: any) {
|
||||
// Ignore
|
||||
}
|
||||
|
@ -89,6 +89,9 @@ export class DomainIndexHelperImpl implements DomainHelper {
|
||||
const added = new Set<string>()
|
||||
|
||||
try {
|
||||
if (!operations.exists(domain)) {
|
||||
return
|
||||
}
|
||||
const has50Documents = documents > 50
|
||||
const allIndexes = (await operations.listIndexes(domain)).filter((it) => it.name !== '_id_')
|
||||
ctx.info('check indexes', { domain, has50Documents, documents })
|
||||
|
Loading…
Reference in New Issue
Block a user