mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
profiling
This commit is contained in:
parent
42c12a3e8a
commit
97f3cd456d
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -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)}`)
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user