File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88use Flowpack \DecoupledContentStore \Core \Infrastructure \ContentReleaseLogger ;
99use Flowpack \DecoupledContentStore \Core \Infrastructure \RedisClientManager ;
1010use Flowpack \DecoupledContentStore \Core \RedisKeyService ;
11+ use Flowpack \DecoupledContentStore \NodeRendering \Dto \NodeRenderingCompletionStatus ;
12+ use Flowpack \DecoupledContentStore \NodeRendering \Infrastructure \RedisRenderingErrorManager ;
1113use Flowpack \DecoupledContentStore \PrepareContentRelease \Infrastructure \RedisContentReleaseService ;
1214use Flowpack \DecoupledContentStore \ReleaseSwitch \Infrastructure \RedisReleaseSwitchService ;
1315use Flowpack \DecoupledContentStore \Transfer \Dto \RedisKeyPostfixesForEachRelease ;
@@ -42,6 +44,11 @@ class ContentReleaseCleaner
4244 */
4345 protected $ redisReleaseSwitchService ;
4446
47+ /**
48+ * @Flow\Inject
49+ * @var RedisRenderingErrorManager
50+ */
51+ protected $ redisRenderingErrorManager ;
4552
4653 /**
4754 * @Flow\Inject
@@ -74,7 +81,10 @@ public function removeOldReleases(RedisInstanceIdentifier $redisInstanceIdentifi
7481 } elseif ($ id ->equals ($ contentReleaseIdentifierOfUpcomingRelease )) {
7582 $ contentReleaseLogger ->info ('- ' . $ id ->getIdentifier () . ' (UPCOMING) ' );
7683 } else {
77- $ i ++;
84+ // on primary: only add to counter if status of release is "success" and release has no errors
85+ if (!$ redisInstanceIdentifier ->isPrimary () || ($ this ->redisContentReleaseService ->fetchMetadataForContentRelease ($ id )->getStatus ()->getStatus () === NodeRenderingCompletionStatus::success ()->getStatus () && count ($ this ->redisRenderingErrorManager ->getRenderingErrors ($ id )) === 0 )) {
86+ $ i ++;
87+ }
7888
7989 // we always want to keep $currentRelease and $contentReleaseIdentifierOfUpcomingRelease; thus
8090 // we need to remove 2 from $contentReleasesToKeep
You can’t perform that action at this time.
0 commit comments