Skip to content

Commit b7bc7a5

Browse files
committed
fix: comments
Signed-off-by: Uroš Marolt <uros@marolt.me>
1 parent c462cc9 commit b7bc7a5

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

services/apps/pcc_sync_worker/src/consumer/pccProjectConsumer.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,25 @@ export class PccProjectConsumer {
170170
'PCC job completed',
171171
)
172172

173-
await this.metadataStore.markCompleted(job.id, {
174-
transformedCount: upsertedCount,
175-
skippedCount: skippedCount + mismatchCount + schemaMismatchCount,
176-
processingDurationMs: durationMs,
177-
})
173+
if (!this.dryRun) {
174+
await this.metadataStore.markCompleted(job.id, {
175+
transformedCount: upsertedCount,
176+
skippedCount: skippedCount + mismatchCount + schemaMismatchCount,
177+
processingDurationMs: durationMs,
178+
})
179+
}
178180
} catch (err) {
179181
const errorMessage = err instanceof Error ? err.message : String(err)
180182
log.error({ jobId: job.id, err }, 'PCC job failed')
181183

182-
try {
183-
await this.metadataStore.markFailed(job.id, errorMessage, {
184-
processingDurationMs: Date.now() - startTime,
185-
})
186-
} catch (updateErr) {
187-
log.error({ jobId: job.id, updateErr }, 'Failed to mark job as failed')
184+
if (!this.dryRun) {
185+
try {
186+
await this.metadataStore.markFailed(job.id, errorMessage, {
187+
processingDurationMs: Date.now() - startTime,
188+
})
189+
} catch (updateErr) {
190+
log.error({ jobId: job.id, updateErr }, 'Failed to mark job as failed')
191+
}
188192
}
189193
}
190194
}

services/apps/pcc_sync_worker/src/parser/rowParser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export function parsePccRow(raw: Record<string, unknown>): ParseResult {
111111
return {
112112
ok: false,
113113
errorType: 'SCHEMA_MISMATCH',
114+
pccProjectId: String(projectId),
115+
pccSlug: (row.SLUG ?? null) as string | null,
114116
details: { reason: cdpTargetResult.reason, rawDepth: depth, effectiveDepth, projectId, name },
115117
}
116118
}

0 commit comments

Comments
 (0)