Skip to content

Commit

Permalink
chore: remove useless unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Mar 5, 2024
1 parent 4c64b2e commit 5c5208b
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ export class WorkspaceResolver {
this.quota.getWorkspaceUsage(workspaceId),
]);
if (memberCount >= quota.memberLimit) {
await this.mutex.unlock(lockFlag);
throw new PayloadTooLargeException('Workspace member limit reached.');
return new PayloadTooLargeException('Workspace member limit reached.');
}

let target = await this.users.findUserByEmail(email);
Expand All @@ -363,7 +362,6 @@ export class WorkspaceResolver {
});
// only invite if the user is not already in the workspace
if (originRecord) {
await this.mutex.unlock(lockFlag);
return originRecord.id;
}
} else {
Expand Down Expand Up @@ -405,13 +403,11 @@ export class WorkspaceResolver {
`failed to send ${workspaceId} invite email to ${email}, but successfully revoked permission: ${e}`
);
}
await this.mutex.unlock(lockFlag);
return new InternalServerErrorException(
'Failed to send invite email. Please try again.'
);
}
}
await this.mutex.unlock(lockFlag);
return inviteId;
});
}
Expand Down

0 comments on commit 5c5208b

Please sign in to comment.