Skip to content

Commit

Permalink
fix(db): remove locking clause when updating designated sender creden…
Browse files Browse the repository at this point in the history
…tials
  • Loading branch information
BastiDood committed Aug 3, 2024
1 parent 3c29377 commit 962e4d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export class Database implements Loggable {
@timed async getDesignatedSenderCredentials() {
const sql = this.#sql;
const [first, ...rest] =
await sql`SELECT email, given_name, family_name, access_token, refresh_token, expiration FROM drap.designated_sender JOIN drap.candidate_senders USING (email) JOIN drap.users USING (email) WHERE user_id IS NOT NULL AND is_admin AND lab_id IS NULL FOR UPDATE OF candidate_senders`;
await sql`SELECT email, given_name, family_name, access_token, refresh_token, expiration FROM drap.designated_sender JOIN drap.candidate_senders USING (email) JOIN drap.users USING (email) WHERE user_id IS NOT NULL AND is_admin AND lab_id IS NULL`;
strictEqual(rest.length, 0);
return typeof first === 'undefined' ? null : parse(DesignatedSenderCredentials, first);
}
Expand Down

0 comments on commit 962e4d2

Please sign in to comment.