From 962e4d25c7a4ecc79f15c47a605e45b5dc112bb2 Mon Sep 17 00:00:00 2001 From: Basti Ortiz <39114273+BastiDood@users.noreply.github.com> Date: Sat, 3 Aug 2024 17:56:33 +0800 Subject: [PATCH] fix(db): remove locking clause when updating designated sender credentials --- database/src/database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/src/database.ts b/database/src/database.ts index 5d8c71d..726f474 100644 --- a/database/src/database.ts +++ b/database/src/database.ts @@ -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); }