Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
defer git-rev-sync call
Browse files Browse the repository at this point in the history
  • Loading branch information
hlolli committed Oct 21, 2021
1 parent e65b274 commit 50c1bc3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/route/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import gitRev from "git-rev-sync";

let gitRevision = "unknown";

try {
gitRevision = gitRev.long([process.cwd()]);
} catch {}

let ready = false;

let lastKnownSessionUuid: CassandraTypes.TimeUuid;
Expand All @@ -31,6 +27,10 @@ interface StatusSchema {
function signalReady(): void {
setTimeout(() => {
if (!ready) {
try {
gitRevision = gitRev.long([process.cwd()]);
} catch {}

ready = true;
}
}, 2000);
Expand Down Expand Up @@ -86,7 +86,7 @@ export async function statusRoute(
next: (error?: string) => void
): Promise<void> {
if (!ready) {
return next("booting - not ready");
response.sendStatus(503);
}
try {
const currentStatus = await statusMapper.get({
Expand Down

0 comments on commit 50c1bc3

Please sign in to comment.