Certificate and token generation fixes

Summary:
A few things need to be done which are on this change:

- Certificate generation should execute as an atomic operation, hence, it needs to be synchronised.
- Do not generate client token as part of certificate generation. This causes a deadlock now.
- Add more logs for troubleshooting

Reviewed By: aigoncharov

Differential Revision: D49269624

fbshipit-source-id: 071a8e5b895198730b7d914cc4622837e9094e2f
This commit is contained in:
Lorenzo Blasa
2023-09-14 04:15:18 -07:00
committed by Facebook GitHub Bot
parent cf599f9c3c
commit 2b4c631652
3 changed files with 33 additions and 27 deletions

View File

@@ -235,6 +235,9 @@ async function start() {
`[flipper-server][bootstrap] FlipperServer created (${serverCreatedMS} ms)`,
);
// At this point, the HTTP server is ready and configuration is set.
await launch();
const t6 = performance.now();
const launchedMS = t6 - t5;
@@ -263,9 +266,6 @@ async function start() {
}
await flipperServer.connect();
// At this point, the HTTP server is ready and configuration is set.
await launch();
const t8 = performance.now();
const appServerStartedMS = t8 - t7;
console.info(
@@ -309,6 +309,8 @@ async function launch() {
console.info('[flipper-server] Launch UI');
const token = await getAuthToken();
console.info('[flipper-server] Token is available: ' + token !== undefined);
const searchParams = new URLSearchParams({token: token ?? ''});
const url = new URL(`http://localhost:${argv.port}?${searchParams}`);