Skip to content

Commit

Permalink
Merge pull request #31 from Flowpack/task-add-url-logging-in-node-ren…
Browse files Browse the repository at this point in the history
…derer-orchestrator

TASK: Add URL logging to NodeRendererOrchestrator
  • Loading branch information
JamesAlias authored Jul 11, 2023
2 parents f75bdb8 + 92cca46 commit 6adb8e0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Classes/NodeRendering/NodeRenderOrchestrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,26 @@ public function renderContentRelease(ContentReleaseIdentifier $contentReleaseIde

$renderedDocumentFromContentCache = $this->redisContentCacheReader->tryToExtractRenderingForEnumeratedNodeFromContentCache(DocumentNodeCacheKey::fromEnumeratedNode($enumeratedNode));
if ($renderedDocumentFromContentCache->isComplete()) {
$contentReleaseLogger->debug('Node fully rendered, adding to content release', ['node' => $enumeratedNode]);
$contentReleaseLogger->debug(
'Node fully rendered, adding to content release',
['url' => $renderedDocumentFromContentCache->getUrl(), 'node' => $enumeratedNode]
);
// NOTE: Eventually consistent (TODO describe)
// If wanted more fully consistent, move to bottom....
$this->nodeRenderingExtensionManager->addRenderedDocumentToContentRelease($contentReleaseIdentifier, $renderedDocumentFromContentCache, $contentReleaseLogger);
} else {
$contentReleaseLogger->debug('Scheduling rendering for Node, as it was not found or its content is incomplete: ' . $renderedDocumentFromContentCache->getIncompleteReason(), ['node' => $enumeratedNode]);
$contentReleaseLogger->debug(
'Scheduling rendering for Node, as it was not found or its content is incomplete: '
. $renderedDocumentFromContentCache->getIncompleteReason(),
['url' => $renderedDocumentFromContentCache->getUrl(), 'node' => $enumeratedNode]
);
// the rendered document was not found, or has holes. so we need to re-render.
$nodesScheduledForRendering[] = $enumeratedNode;
$this->redisRenderingQueue->appendRenderingJob($contentReleaseIdentifier, $enumeratedNode);
}
}

if (count($nodesScheduledForRendering) === 0) {
if (empty($nodesScheduledForRendering)) {
// we have NO nodes scheduled for rendering anymore, so that means we FINISHED successfully.
$contentReleaseLogger->info('Everything rendered completely. Finishing RenderOrchestrator');

Expand Down

0 comments on commit 6adb8e0

Please sign in to comment.