Skip to content

Commit

Permalink
Merge pull request #1787 from serlo/fix-deadlock-add-role
Browse files Browse the repository at this point in the history
Fix mysql deadlock
  • Loading branch information
hugotiburtino authored Oct 29, 2024
2 parents c5bfc43 + c55b49b commit 512c324
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/server/src/schema/uuid/user/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,18 +320,6 @@ export const resolvers: Resolvers = {
if (id == null) {
throw new UserInputError('no user with given username')
}
await database.mutate(
`
INSERT INTO role (name)
SELECT ?
WHERE NOT EXISTS (
SELECT 1
FROM role
WHERE name = ?
)
`,
[generateRole(role, instance), generateRole(role, instance)],
)

await database.mutate(
`
Expand Down

0 comments on commit 512c324

Please sign in to comment.