From 4cad18f51c3734138b423102b6eccf50a5a78840 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Mon, 5 Jun 2023 17:52:36 +0800 Subject: [PATCH 1/2] fix taskId not being set in the cloud task payload --- packages/import-handler/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/import-handler/src/index.ts b/packages/import-handler/src/index.ts index 269ad463c..62a8fc0ef 100644 --- a/packages/import-handler/src/index.ts +++ b/packages/import-handler/src/index.ts @@ -109,6 +109,7 @@ const importURL = async ( labels: labels?.map((l) => { return { name: l } }), + taskId, }) } From 63bddf13a1e8356546fb61753836dd71d0462fb7 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Mon, 5 Jun 2023 18:16:41 +0800 Subject: [PATCH 2/2] set default metrics to zero --- packages/import-handler/src/metrics.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/import-handler/src/metrics.ts b/packages/import-handler/src/metrics.ts index 1fef1f7f8..953a8a543 100644 --- a/packages/import-handler/src/metrics.ts +++ b/packages/import-handler/src/metrics.ts @@ -87,13 +87,13 @@ export const getMetrics = async ( return { // convert to integer - started: parseInt(metrics.started, 10), - invalid: parseInt(metrics.invalid, 10), - imported: parseInt(metrics.imported, 10), - failed: parseInt(metrics.failed, 10), - total: parseInt(metrics.total, 10), + started: parseInt(metrics.started, 10) || 0, + invalid: parseInt(metrics.invalid, 10) || 0, + imported: parseInt(metrics.imported, 10) || 0, + failed: parseInt(metrics.failed, 10) || 0, + total: parseInt(metrics.total, 10) || 0, source: metrics.source, - state: parseInt(metrics.state, 10), + state: parseInt(metrics.state, 10) || ImportTaskState.STARTED, startTime: parseInt(metrics.start_time, 10), endTime: parseInt(metrics.end_time, 10), }