Skip to content

Commit

Permalink
fix: bug fix rendering engine restart (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saelmala authored Nov 27, 2024
1 parent d6d025e commit 48d75ef
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/api/manager/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,31 @@ export async function stopProduction(
);

if (productionHasRenderingEngineSources) {
const ingestPipelineUuids = (await getPipelines()).map(
(pipeline) => pipeline.uuid
);

for (const pipeline of production.production_settings.pipelines) {
const pipelineId = pipeline.pipeline_id;
if (pipelineId) {
const htmlSources = await getPipelineRenderingEngineHtml(pipelineId);
const mediaSources = await getPipelineRenderingEngineMedia(pipelineId);

// Make sure pipeline ID exists before attempting to get rendering engine
const pipelineIdExists = pipelineId
? ingestPipelineUuids.includes(pipelineId)
: false;

if (pipelineId && pipelineIdExists) {
const htmlSources = await getPipelineRenderingEngineHtml(
pipelineId
).catch((error) => {
Log().error('Failed to fetch HTML sources from pipeline: ', error);
return [];
});
const mediaSources = await getPipelineRenderingEngineMedia(
pipelineId
).catch((error) => {
Log().error('Failed to fetch Media sources from pipeline: ', error);
return [];
});

if (htmlSources.length > 0 && htmlSources) {
for (const pipeline of production.production_settings.pipelines) {
Expand Down

0 comments on commit 48d75ef

Please sign in to comment.