From 8d6a451545498ad533c15be7be0625c775809321 Mon Sep 17 00:00:00 2001 From: Ashoat Tevosyan Date: Sun, 9 Jul 2023 14:13:53 -0400 Subject: [PATCH] [keyserver] Fix stalling of keyserver public key script Summary: Should've noticed this in D8448. We initialize the MySQL connection but never close it, which is why the script stalls. This is addressed by using the `main` util (all scripts are supposed to use this). Test Plan: Run script locally, confirm it no longer stalls Reviewers: varun Reviewed By: varun Subscribers: tomek Differential Revision: https://phab.comm.dev/D8449 --- keyserver/src/scripts/get-keyserver-public-key.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keyserver/src/scripts/get-keyserver-public-key.js b/keyserver/src/scripts/get-keyserver-public-key.js index cf2f7dc5b1..9a9519f8ff 100644 --- a/keyserver/src/scripts/get-keyserver-public-key.js +++ b/keyserver/src/scripts/get-keyserver-public-key.js @@ -1,11 +1,12 @@ // @flow +import { main } from './utils.js'; import { fetchOlmAccount } from '../updaters/olm-account-updater.js'; // Outputs the keyserver's signing ed25519 public key -async function main() { +async function getKeyserverPublicKey() { const info = await fetchOlmAccount('content'); console.log(JSON.parse(info.account.identity_keys()).ed25519); } -main(); +main([getKeyserverPublicKey]);