mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
optimize log-output
This commit is contained in:
parent
0161949405
commit
3e22b07806
@ -51,7 +51,7 @@ export class FederationClient {
|
||||
}
|
||||
|
||||
getPublicCommunityInfo = async (): Promise<PublicCommunityInfo | undefined> => {
|
||||
logger.info(`getPublicCommunityInfo with endpoint='${this.endpoint}'...`)
|
||||
logger.info(`Federation: getPublicCommunityInfo with endpoint='${this.endpoint}'...`)
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const { data } = await this.client.rawRequest(getPublicCommunityInfo, {})
|
||||
@ -63,12 +63,9 @@ export class FederationClient {
|
||||
)
|
||||
return
|
||||
}
|
||||
logger.info(
|
||||
'Federation: getPublicCommunityInfo successful from endpoint',
|
||||
this.endpoint,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
data.getPublicCommunityInfo,
|
||||
)
|
||||
logger.info(`Federation: getPublicCommunityInfo successful from endpoint=${this.endpoint}`)
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
logger.debug(`publicCommunityInfo:`, data.getPublicCommunityInfo)
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
||||
return data.getPublicCommunityInfo
|
||||
} catch (err) {
|
||||
|
||||
@ -47,18 +47,14 @@ export async function validateCommunities(): Promise<void> {
|
||||
const pubKey = await client.getPublicKey()
|
||||
if (pubKey && pubKey === dbCom.publicKey.toString()) {
|
||||
await DbFederatedCommunity.update({ id: dbCom.id }, { verifiedAt: new Date() })
|
||||
logger.info('Federation: verified community', dbCom)
|
||||
logger.info(`Federation: verified community: id=${dbCom.id}, endpoint=${dbCom.endPoint}`)
|
||||
const pubComInfo = await client.getPublicCommunityInfo()
|
||||
if (pubComInfo) {
|
||||
await writeForeignCommunity(dbCom, pubComInfo)
|
||||
logger.info(`Federation: write foreign community... successfully`)
|
||||
logger.info(`Federation: write publicInfo of community: name=${pubComInfo.name}`)
|
||||
}
|
||||
} else {
|
||||
logger.warn(
|
||||
'Federation: received not matching publicKey:',
|
||||
pubKey,
|
||||
dbCom.publicKey.toString(),
|
||||
)
|
||||
logger.warn(`Federation: received none or not matching publicKey...`)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user