Skip to content

Commit

Permalink
💡 Report total time on full sync
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaTheMiller committed Mar 26, 2023
1 parent b92c9e5 commit 3b9bb94
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/handlers/syncAll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export async function syncAllHandler(
_req: Request,
res: Response
) {
const start = Date.now();

const client = GetClient();
const installations = await client.GetInstallations();

Expand All @@ -24,5 +26,12 @@ export async function syncAllHandler(

const results = await Promise.all(orgSyncPromises);

return res.status(200).json(results);
const end = Date.now();

const resultObject = {
orgSyncResults: results,
timeToCompleteInMilliseconds: end - start
}

return res.status(200).json(resultObject);
}

0 comments on commit 3b9bb94

Please sign in to comment.