Skip to content

Commit ce64170

Browse files
committed
FEATURE: Make iteration checks in NodeRenderer configurable
1 parent ba2248f commit ce64170

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Classes/NodeRendering/NodeRenderer.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
*/
5252
class NodeRenderer
5353
{
54+
protected const RESTART_AFTER_RENDER_COUNT = 100;
55+
protected const CHECK_FOR_CONCURRENT_RELEASES_RENDER_COUNT = 5;
5456

5557
/**
5658
* @Flow\Inject
@@ -158,12 +160,12 @@ public function render(ContentReleaseIdentifier $contentReleaseIdentifier, Conte
158160

159161
$i++;
160162

161-
if ($i % 5 === 0) {
163+
if (self::CHECK_FOR_CONCURRENT_RELEASES_RENDER_COUNT > 0 && $i % self::CHECK_FOR_CONCURRENT_RELEASES_RENDER_COUNT === 0) {
162164
$this->concurrentBuildLockService->assertNoOtherContentReleaseWasStarted($contentReleaseIdentifier);
163165
}
164166

165-
if ($i % 20 === 0) {
166-
$contentReleaseLogger->info('Restarting after 20 renders.');
167+
if ($i % self::RESTART_AFTER_RENDER_COUNT === 0) {
168+
$contentReleaseLogger->info(sprintf('Restarting after %d renders.', self::RESTART_AFTER_RENDER_COUNT));
167169
yield ExitEvent::createWithStatusCode(193);
168170
return;
169171
}

0 commit comments

Comments
 (0)