From 3b39cd42461fa1fef93770060bc1a4733020e519 Mon Sep 17 00:00:00 2001 From: Ryan Goetz Date: Tue, 6 Feb 2024 13:53:47 -1000 Subject: [PATCH] Added helpful logging messages to the workers for troubleshooting. --- sequencing-server/src/worker.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sequencing-server/src/worker.ts b/sequencing-server/src/worker.ts index 44e040b3ea..37c9bbc0a0 100644 --- a/sequencing-server/src/worker.ts +++ b/sequencing-server/src/worker.ts @@ -26,7 +26,13 @@ export async function typecheckExpansion(opts: { expansionLogic: string; commandTypes: string; activityTypes: string; + activityTypeName?: string; }): Promise[]>> { + const startTime = Date.now(); + console.log( + `[ Worker ] started transpiling authoring logic ${opts.activityTypeName ? `- ${opts.activityTypeName}` : ''}`, + ); + const result = await codeRunner.preProcess( opts.expansionLogic, 'ExpansionReturn', @@ -37,6 +43,14 @@ export async function typecheckExpansion(opts: { ts.createSourceFile('TemporalPolyfillTypes.ts', temporalPolyfillTypes, compilerTarget), ], ); + + const endTime = Date.now(); + console.log( + `[ Worker ] finished transpiling ${opts.activityTypeName ? `- ${opts.activityTypeName}` : ''}, (${ + (endTime - startTime) / 1000 + } s)`, + ); + if (result.isOk()) { return Result.Ok(result.unwrap()).toJSON(); } else {