profiling

This commit is contained in:
einhornimmond 2024-05-09 13:26:53 +02:00
parent 42c12a3e8a
commit 97f3cd456d
4 changed files with 8 additions and 3 deletions

View File

@ -105,7 +105,10 @@ export class HumHubClient {
}
public async userByEmailAsync(email: string): Promise<IRestResponse<GetUser>> {
const startTime = new Date()
const options = await this.createRequestOptions({ email })
const endTime = new Date()
console.log("time for prepare connection: ", endTime.getTime() - startTime.getTime())
return this.restClient.get<GetUser>('/api/v1/user/get-by-email', options)
}

View File

@ -39,8 +39,7 @@ export async function syncUser(
if (humhubUser) {
if (!user.humhubAllowed) {
postUser.account.status = 0
await humHubClient.updateUser(postUser, humhubUser.id)
await humHubClient.deleteUser(humhubUser.id)
return ExecutedHumhubAction.DELETE
}
if (!isHumhubUserIdenticalToDbUser(humhubUser, user)) {

View File

@ -200,7 +200,10 @@ export class UserResolver {
await EVENT_USER_LOGIN(dbUser)
// load humhub state
if (CONFIG.HUMHUB_ACTIVE && user.humhubAllowed) {
const startTime = new Date()
const result = await humhubUserPromise
const endTime = new Date()
console.log("wait for humhub at login ", endTime.getTime() - startTime.getTime())
user.humhubAllowed = result?.result?.account.status === 1
}
logger.info(`successful Login: ${JSON.stringify(user, null, 2)}`)

View File

@ -241,7 +241,7 @@ export default {
return firstName === this.firstName && lastName === this.lastName
},
isHumhubActivated() {
return false // this.humhubAllowed
return this.humhubAllowed
},
isCommunityService() {
return this.isGMS || this.isHumhub