Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Classes/Aspects/CacheUrlMappingAspect.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function storeRootCacheIdentifier(JoinPointInterface $joinPoint): void
. (
$extractedExceptionDto !== null ? "\nException extracted from output: {$extractedExceptionDto}" : ''
),
1539156004
1539156004,
);
}

Expand All @@ -165,7 +165,7 @@ public function storeRootCacheIdentifier(JoinPointInterface $joinPoint): void
$logger->info(sprintf(
'Skipping URL %s, because it matches the blacklist %s',
$url,
$this->urlExcludelistRegex
$this->urlExcludelistRegex,
));

return;
Expand All @@ -174,7 +174,7 @@ public function storeRootCacheIdentifier(JoinPointInterface $joinPoint): void
if ($rootIdentifier === null) {
throw new Exception(
'Could not find root cache identifier for ' . $url . ', possible rendering error?',
1491394849
1491394849,
);
}

Expand All @@ -185,19 +185,19 @@ public function storeRootCacheIdentifier(JoinPointInterface $joinPoint): void
$rootKey = DocumentNodeCacheKey::fromNodeAndArguments($node, $arguments);
$rootCacheValues = DocumentNodeCacheValues::create($rootIdentifier, $url)->withMetadata(
'renderTime',
(int) ( microtime(true) * 1000 ) - $this->renderTimestamp
(int) (microtime(true) * 1000) - $this->renderTimestamp,
);
// allow other document metadata generators here
$rootCacheValues = $this->nodeRenderingExtensionManager->runDocumentMetadataGenerators(
$node,
$arguments,
$this->controllerContext,
$rootCacheValues
$rootCacheValues,
);
$this->contentCacheFrontend->set(
$rootKey->redisKeyName(),
json_encode($rootCacheValues, JSON_THROW_ON_ERROR),
$rootTags
$rootTags,
);
$this->mappingWasWrittenForCurrentDocument = true;
}
Expand Down Expand Up @@ -253,7 +253,7 @@ public function beforeDocumentRendering(ContentReleaseLogger $contentReleaseLogg
{
$this->isActive = true;
$this->contentReleaseLogger = $contentReleaseLogger;
$this->renderTimestamp = (int) ( microtime(true) * 1000 );
$this->renderTimestamp = (int) (microtime(true) * 1000);
$this->mappingWasWrittenForCurrentDocument = false;
}

Expand All @@ -265,7 +265,7 @@ public function afterDocumentRendering(): void
// about the reason. {@see storeRootCacheIdentifier()}
if (!$this->mappingWasWrittenForCurrentDocument && $this->contentReleaseLogger !== null) {
$this->contentReleaseLogger->warn(
'No "doc--..." mapping entry was written for this rendering, so it can never be added to the content release. Either the rendering was fully served from the content cache (then the content cache entries of this node need to be flushed before re-rendering), or its URL is excluded via nodeRendering.urlExcludelistRegex while the node is still part of the enumeration.'
'No "doc--..." mapping entry was written for this rendering, so it can never be added to the content release. Either the rendering was fully served from the content cache (then the content cache entries of this node need to be flushed before re-rendering), or its URL is excluded via nodeRendering.urlExcludelistRegex while the node is still part of the enumeration.',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function registerAssetChange(JoinPointInterface $joinPoint)
$tagsToFlush[$assetCacheTag] = sprintf(
'which were tagged with "%s" because asset "%s" has changed.',
$assetCacheTag,
$assetIdentifier
$assetIdentifier,
);
ObjectAccess::setProperty($contentCacheFlusher, 'tagsToFlush', $tagsToFlush, true);

Expand All @@ -128,7 +128,7 @@ public function registerAssetChange(JoinPointInterface $joinPoint)
'workspaceName' => $assetUsage->getWorkspaceName(),
'dimensions' => $assetUsage->getDimensionValues(),
'invisibleContentShown' => true,
'removedContentShown' => true
'removedContentShown' => true,
]);

$node = $context->getNodeByIdentifier($assetUsage->getNodeIdentifier());
Expand All @@ -144,7 +144,7 @@ public function registerAssetChange(JoinPointInterface $joinPoint)
$tagsToFlush[$assetCacheTagWithWorkspace] = sprintf(
'which were tagged with "%s" because asset "%s" has changed.',
$assetCacheTagWithWorkspace,
$assetIdentifier
$assetIdentifier,
);
ObjectAccess::setProperty($contentCacheFlusher, 'tagsToFlush', $tagsToFlush, true);

Expand Down
6 changes: 3 additions & 3 deletions Classes/BackendUi/AutomaticReleaseStatusDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public function getData(?NodeInterface $node = null, array $arguments = []): arr
'automaticReleases.paused.contentModuleWarning',
[
$this->backendDateFormatter->format($pauseState->getPausedAt()),
$pauseState->getSuppressedReleaseCount()
$pauseState->getSuppressedReleaseCount(),
],
null,
null,
'Main',
'Flowpack.DecoupledContentStore'
)
'Flowpack.DecoupledContentStore',
),
];
}
}
2 changes: 1 addition & 1 deletion Classes/BackendUi/BackendDateFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function format(\DateTimeInterface $dateTime): string
return $this->datetimeFormatter->formatDateTime(
$dateTime,
$this->localizationService->getConfiguration()->getCurrentLocale(),
DatesReader::FORMAT_LENGTH_MEDIUM
DatesReader::FORMAT_LENGTH_MEDIUM,
);
}
}
36 changes: 18 additions & 18 deletions Classes/BackendUi/BackendUiDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use Flowpack\DecoupledContentStore\PrepareContentRelease\Dto\ContentReleaseMetadata;
use Flowpack\DecoupledContentStore\PrepareContentRelease\Infrastructure\RedisContentReleaseService;
use Flowpack\DecoupledContentStore\ReleaseSwitch\Infrastructure\RedisReleaseSwitchService;
use Neos\Flow\Annotations as Flow;
use Flowpack\Prunner\PrunnerApiService;
use Neos\Flow\Annotations as Flow;

/**
* @Flow\Scope("singleton")
Expand Down Expand Up @@ -65,33 +65,33 @@ public function loadBackendOverviewData(RedisInstanceIdentifier $redisInstanceId
$contentReleaseIds = $this->redisContentReleaseService->fetchAllReleaseIds($redisInstanceIdentifier);
$metadata = $this->redisContentReleaseService->fetchMetadataForContentReleases(
$redisInstanceIdentifier,
...$contentReleaseIds
...$contentReleaseIds,
);
$counts = $this->redisEnumerationRepository->countMultiple($redisInstanceIdentifier, ...$contentReleaseIds);
$iterationsCounts = $this->redisRenderingStatisticsStore->countMultipleRenderingStatistics(
$redisInstanceIdentifier,
...$contentReleaseIds
...$contentReleaseIds,
);
$errorCounts = $this->redisRenderingErrorManager->countMultipleErrors(
$redisInstanceIdentifier,
...$contentReleaseIds
...$contentReleaseIds,
);
$lastRenderingStatisticsEntries = $this->redisRenderingStatisticsStore->getLastRenderingStatisticsEntry(
$redisInstanceIdentifier,
...$contentReleaseIds
...$contentReleaseIds,
);
$firstRenderingStatisticsEntries = $this->redisRenderingStatisticsStore->getFirstRenderingStatisticsEntry(
$redisInstanceIdentifier,
...$contentReleaseIds
...$contentReleaseIds,
);

$result = [];
foreach ($contentReleaseIds as $contentReleaseId) {
$lastRendering = RenderingStatistics::fromJsonString($lastRenderingStatisticsEntries->getResultForContentRelease(
$contentReleaseId
$contentReleaseId,
));
$firstRendering = RenderingStatistics::fromJsonString($firstRenderingStatisticsEntries->getResultForContentRelease(
$contentReleaseId
$contentReleaseId,
));

$metadataForContentRelease = $metadata->getResultForContentRelease($contentReleaseId);
Expand All @@ -106,15 +106,15 @@ public function loadBackendOverviewData(RedisInstanceIdentifier $redisInstanceId
is_int($iterationsCountForContentRelease) ? $iterationsCountForContentRelease : 0,
is_int($errorCountForContentRelease) ? $errorCountForContentRelease : 0,
$lastRendering->getTotalJobs() > 0
? round(( $lastRendering->getRenderedJobs() / $lastRendering->getTotalJobs() ) * 100)
? round(($lastRendering->getRenderedJobs() / $lastRendering->getTotalJobs()) * 100)
: 100,
$firstRendering->getRenderedJobs(),
$contentReleaseId->equals($this->redisReleaseSwitchService->getCurrentRelease(
$redisInstanceIdentifier
$redisInstanceIdentifier,
)),
$metadataForContentRelease instanceof ContentReleaseMetadata
? $metadataForContentRelease->getContentReleaseSize()
: null
: null,
);
}

Expand All @@ -123,19 +123,19 @@ public function loadBackendOverviewData(RedisInstanceIdentifier $redisInstanceId

public function loadDetailsData(
ContentReleaseIdentifier $contentReleaseIdentifier,
RedisInstanceIdentifier $redisInstanceIdentifier
RedisInstanceIdentifier $redisInstanceIdentifier,
): ?ContentReleaseDetails {
$contentReleaseMetadata = $this->redisContentReleaseService->fetchMetadataForContentRelease(
$contentReleaseIdentifier,
$redisInstanceIdentifier
$redisInstanceIdentifier,
);

if (!$contentReleaseMetadata) {
return null;
}

$contentReleaseJob = $this->prunnerApiService->loadJobDetail(
$contentReleaseMetadata->getPrunnerJobId()->toJobId()
$contentReleaseMetadata->getPrunnerJobId()->toJobId(),
);

$manualTransferJobs = count($contentReleaseMetadata->getManualTransferJobIds())
Expand All @@ -150,13 +150,13 @@ function (string $item) {
},
$this->redisRenderingStatisticsStore->getRenderingStatistics(
$contentReleaseIdentifier,
$redisInstanceIdentifier
)
$redisInstanceIdentifier,
),
);

$renderingErrorCount = count($this->redisRenderingErrorManager->getRenderingErrors(
$contentReleaseIdentifier,
$redisInstanceIdentifier
$redisInstanceIdentifier,
));

$currentReleaseIdentifier = $this->redisReleaseSwitchService->getCurrentRelease($redisInstanceIdentifier);
Expand All @@ -169,7 +169,7 @@ function (string $item) {
$renderingErrorCount,
$contentReleaseIdentifier->equals($currentReleaseIdentifier),
$manualTransferJobs,
$contentReleaseMetadata->getContentReleaseSize()
$contentReleaseMetadata->getContentReleaseSize(),
);
}
}
2 changes: 1 addition & 1 deletion Classes/BackendUi/Dto/ContentReleaseDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
int $renderingErrorCount,
bool $isActive,
array $manualTransferJobIds,
?float $contentReleaseSize = null
?float $contentReleaseSize = null,
) {
$this->contentReleaseIdentifier = $contentReleaseIdentifier;
$this->job = $job;
Expand Down
2 changes: 1 addition & 1 deletion Classes/BackendUi/Dto/ContentReleaseOverviewRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
float $progress,
int $renderedUrlCount,
bool $isActive,
?float $releaseSize
?float $releaseSize,
) {
$this->contentReleaseIdentifier = $contentReleaseIdentifier;
$this->metadata = $metadata;
Expand Down
2 changes: 1 addition & 1 deletion Classes/BackendUi/Dto/WorkerErrorLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
public int $exitCode,
public ?string $taskError,
public array $errorBlocks,
public ?string $lastAttemptedNode = null
public ?string $lastAttemptedNode = null,
) {
$this->wasKilledByOrchestrator = $this->exitCode === WorkerErrorLogAggregator::EXIT_CODE_SIGTERM;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/BackendUi/RenderingErrorExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function extractLastAttemptedNode(string $log): ?string
'/"node"\s*:\s*"((?:\\\\.|[^"\\\\])*)"(?:\s*,\s*"nodeUri"\s*:\s*"((?:\\\\.|[^"\\\\])*)")?/',
$log,
$matches,
PREG_SET_ORDER
PREG_SET_ORDER,
)) {
return null;
}
Expand Down
9 changes: 4 additions & 5 deletions Classes/BackendUi/WorkerErrorLogAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class WorkerErrorLogAggregator
*/
public function aggregate(Job $job): array
{
$renderTasks = $job
->getTaskResults()
$renderTasks = $job->getTaskResults()
->filteredByPrefix('render_')
->withoutTasks('render_finished', 'render_orchestrator');

Expand All @@ -60,8 +59,8 @@ public function aggregate(Job $job): array
// sort worker names naturally (1, 2, ..., 10 instead of 1, 10, ..., 2).
usort($erroredTasks, static function (TaskResult $a, TaskResult $b): int {
$killedComparison =
( $a->getExitCode() === self::EXIT_CODE_SIGTERM ? 1 : 0 )
<=> ( $b->getExitCode() === self::EXIT_CODE_SIGTERM ? 1 : 0 );
($a->getExitCode() === self::EXIT_CODE_SIGTERM ? 1 : 0)
<=> ($b->getExitCode() === self::EXIT_CODE_SIGTERM ? 1 : 0);

return $killedComparison !== 0 ? $killedComparison : strnatcasecmp($a->getName(), $b->getName());
});
Expand All @@ -83,7 +82,7 @@ public function aggregate(Job $job): array
$task->getExitCode(),
$task->getError() ?: null,
$blocks,
$lastAttemptedNode
$lastAttemptedNode,
);
}

Expand Down
6 changes: 3 additions & 3 deletions Classes/Command/ContentReleaseEventsCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace Flowpack\DecoupledContentStore\Command;

use Flowpack\DecoupledContentStore\Core\Domain\ValueObject\ContentReleaseIdentifier;
use Flowpack\DecoupledContentStore\Core\Domain\ValueObject\PrunnerJobId;
use Flowpack\DecoupledContentStore\Core\Infrastructure\ContentReleaseLogger;
use Flowpack\DecoupledContentStore\Core\Infrastructure\RedisStatisticsEventService;
use Neos\Flow\Annotations as Flow;
use Flowpack\DecoupledContentStore\Core\Domain\ValueObject\ContentReleaseIdentifier;
use Flowpack\DecoupledContentStore\Core\Infrastructure\ContentReleaseLogger;
use Neos\Flow\Cli\CommandController;

/**
Expand Down Expand Up @@ -38,7 +38,7 @@ class ContentReleaseEventsCommandController extends CommandController
public function countStatisticsEventCommand(
string $contentReleaseIdentifier,
string $where = '',
string $groupBy = ''
string $groupBy = '',
): void {
$contentReleaseIdentifier = ContentReleaseIdentifier::fromString($contentReleaseIdentifier);
// split every string in $where by the first '=' and use the left part as key and the right part as value
Expand Down
12 changes: 6 additions & 6 deletions Classes/Command/ContentReleasePrepareCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace Flowpack\DecoupledContentStore\Command;

use Flowpack\DecoupledContentStore\Core\ConcurrentBuildLockService;
use Flowpack\DecoupledContentStore\Core\Domain\ValueObject\ContentReleaseIdentifier;
use Flowpack\DecoupledContentStore\Core\Domain\ValueObject\PrunnerJobId;
use Flowpack\DecoupledContentStore\Core\Infrastructure\ContentReleaseLogger;
use Flowpack\DecoupledContentStore\PrepareContentRelease\Infrastructure\RedisContentReleaseService;
use Neos\Flow\Annotations as Flow;
use Flowpack\DecoupledContentStore\Core\Domain\ValueObject\ContentReleaseIdentifier;
use Flowpack\DecoupledContentStore\Core\Infrastructure\ContentReleaseLogger;
use Neos\Flow\Cli\CommandController;
use Neos\Fusion\Core\Cache\ContentCache;

Expand Down Expand Up @@ -40,7 +40,7 @@ public function createContentReleaseCommand(
string $contentReleaseIdentifier,
string $prunnerJobId,
string $workspaceName = 'live',
string $accountId = 'cli'
string $accountId = 'cli',
): void {
$contentReleaseIdentifier = ContentReleaseIdentifier::fromString($contentReleaseIdentifier);
$prunnerJobId = PrunnerJobId::fromString($prunnerJobId);
Expand All @@ -50,7 +50,7 @@ public function createContentReleaseCommand(
$prunnerJobId,
$logger,
$workspaceName,
$accountId
$accountId,
);
}

Expand All @@ -72,11 +72,11 @@ public function registerManualTransferJobCommand(string $contentReleaseIdentifie

public function flushContentCacheIfRequiredCommand(
string $contentReleaseIdentifier,
bool $flushContentCache = false
bool $flushContentCache = false,
): void {
$logger = ContentReleaseLogger::fromConsoleOutput(
$this->output,
ContentReleaseIdentifier::fromString($contentReleaseIdentifier)
ContentReleaseIdentifier::fromString($contentReleaseIdentifier),
);
if (!$flushContentCache) {
$logger->info('Not flushing content cache');
Expand Down
Loading