File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -411,6 +411,10 @@ patchlevel_event_sourcing:
411411
412412 This works only before each http requests and not if you use the console commands.
413413
414+ !!! tip
415+
416+ This is using the cache system to store the latest file change time. You can change the cache pool with the `cache_pool` option.
417+
414418# # Command Bus
415419
416420You can also enable and register our handlers in symfony messenger.
Original file line number Diff line number Diff line change 2626 * ids: list<string>,
2727 * groups: list<string>,
2828 * },
29- * rebuild_after_file_change: bool
29+ * rebuild_after_file_change: array{enabled: bool, cache_pool: string}
3030 * },
3131 * connection: ?array{
3232 * service: ?string,
@@ -220,7 +220,13 @@ public function getConfigTreeBuilder(): TreeBuilder
220220 ->end ()
221221 ->end ()
222222
223- ->booleanNode ('rebuild_after_file_change ' )->defaultFalse ()->end ()
223+ ->arrayNode ('rebuild_after_file_change ' )
224+ ->canBeEnabled ()
225+ ->addDefaultsIfNotSet ()
226+ ->children ()
227+ ->scalarNode ('cache_pool ' )->defaultValue ('cache.app ' )->end ()
228+ ->end ()
229+ ->end ()
224230 ->end ()
225231 ->end ()
226232
Original file line number Diff line number Diff line change @@ -429,15 +429,15 @@ static function (ChildDefinition $definition): void {
429429 ]);
430430 }
431431
432- if (!$ config ['subscription ' ]['rebuild_after_file_change ' ]) {
432+ if (!$ config ['subscription ' ]['rebuild_after_file_change ' ][ ' enabled ' ] ) {
433433 return ;
434434 }
435435
436436 $ container ->register (SubscriptionRebuildAfterFileChangeListener::class)
437437 ->setArguments ([
438438 new Reference (SubscriptionEngine::class),
439439 new TaggedIteratorArgument ('event_sourcing.subscriber ' ),
440- new Reference (' cache.app ' ),
440+ new Reference ($ config [ ' subscription ' ][ ' rebuild_after_file_change ' ][ ' cache_pool ' ] ),
441441 new Reference (SubscriberMetadataFactory::class),
442442 ])
443443 ->addTag ('kernel.event_listener ' , [
You can’t perform that action at this time.
0 commit comments