FIX: do not throw errors when deleting input or transformation on pipeline delete

This commit is contained in:
Gabriel Rosa
2022-10-26 10:52:12 -03:00
parent 932616a578
commit fc7a9c7909
+20 -8
View File
@@ -169,20 +169,32 @@ export class PipelinesService implements OnModuleInit {
? JSON.parse(pipeline.config.tables)
: null;
if (input)
await this.inputsService.remove({
id: input.input_id,
info,
});
await this.inputsService
.remove({
id: input.input_id,
info,
})
.catch((error) =>
this.logger.error('Could not delete input', {
data: { input, error },
}),
);
const transformations: { id: string }[] = pipeline.transformations
? JSON.parse(pipeline.transformations)
: null;
if (transformations && transformations.length)
for (const transformation of transformations) {
await this.transformationsService.remove({
id: transformation.id,
info,
});
await this.transformationsService
.remove({
id: transformation.id,
info,
})
.catch((error) =>
this.logger.error('Could not delete transformation', {
data: { transformation, error },
}),
);
}
}