Skip to content

Commit

Permalink
Merge branch 'main' into N21-2103-update-media-activations
Browse files Browse the repository at this point in the history
  • Loading branch information
GordonNicholasCap authored Dec 18, 2024
2 parents de94936 + 9a1c294 commit 3200b50
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(GroupProvisioningInfoLoggable.name, () => {
otherUsers: externalGroupUserDtoFactory.buildList(otherUserCount),
});

const loggable = new GroupProvisioningInfoLoggable(externalGroups, 100);
const loggable = new GroupProvisioningInfoLoggable(externalGroups, 100, 'igorHatGesagt');

return {
loggable,
Expand All @@ -31,6 +31,7 @@ describe(GroupProvisioningInfoLoggable.name, () => {
groupCount,
userCount: totalUserCount,
durationMs: 100,
externalUserId: 'igorHatGesagt',
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { ErrorLogMessage, Loggable, LogMessage, ValidationErrorLogMessage } from
import { ExternalGroupDto } from '../dto';

export class GroupProvisioningInfoLoggable implements Loggable {
constructor(private readonly groups: ExternalGroupDto[], private readonly durationMs: number) {}
constructor(
private readonly groups: ExternalGroupDto[],
private readonly durationMs: number,
private readonly externalUserId: string
) {}

public getLogMessage(): LogMessage | ErrorLogMessage | ValidationErrorLogMessage {
const userCount = this.groups.reduce(
Expand All @@ -16,6 +20,7 @@ export class GroupProvisioningInfoLoggable implements Loggable {
groupCount: this.groups.length,
userCount,
durationMs: this.durationMs,
externalUserId: this.externalUserId,
},
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ export abstract class SchulconnexProvisioningStrategy extends ProvisioningStrate
}

const endTime = performance.now();
this.logger.warning(new GroupProvisioningInfoLoggable(data.externalGroups ?? [], endTime - startTime));
this.logger.warning(
new GroupProvisioningInfoLoggable(data.externalGroups ?? [], endTime - startTime, data.externalUser.externalId)
);
}

private async removeUserFromGroups(data: OauthDataDto): Promise<void> {
Expand Down

0 comments on commit 3200b50

Please sign in to comment.