Skip to content

Commit 3b9bb94

Browse files
💡 Report total time on full sync
1 parent b92c9e5 commit 3b9bb94

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/handlers/syncAll.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export async function syncAllHandler(
88
_req: Request,
99
res: Response
1010
) {
11+
const start = Date.now();
12+
1113
const client = GetClient();
1214
const installations = await client.GetInstallations();
1315

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

2527
const results = await Promise.all(orgSyncPromises);
2628

27-
return res.status(200).json(results);
29+
const end = Date.now();
30+
31+
const resultObject = {
32+
orgSyncResults: results,
33+
timeToCompleteInMilliseconds: end - start
34+
}
35+
36+
return res.status(200).json(resultObject);
2837
}

0 commit comments

Comments
 (0)