|
4 | 4 |
|
5 | 5 | namespace Patchlevel\EventSourcingBundle\DependencyInjection; |
6 | 6 |
|
7 | | -use DateInterval; |
8 | | -use DateTimeImmutable; |
9 | 7 | use Doctrine\DBAL\Connection; |
10 | 8 | use Doctrine\Migrations\Configuration\Connection\ExistingConnection; |
11 | 9 | use Doctrine\Migrations\Configuration\Migration\ConfigurationArray; |
|
117 | 115 | use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberAccessorRepository; |
118 | 116 | use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberHelper; |
119 | 117 | use Patchlevel\EventSourcingBundle\Attribute\AsListener; |
| 118 | +use Patchlevel\EventSourcingBundle\Clock\FrozenClockFactory; |
120 | 119 | use Patchlevel\EventSourcingBundle\Command\StoreMigrateCommand; |
121 | 120 | use Patchlevel\EventSourcingBundle\CommandBus\SymfonyCommandBus; |
122 | 121 | use Patchlevel\EventSourcingBundle\DataCollector\EventSourcingCollector; |
|
126 | 125 | use Patchlevel\EventSourcingBundle\QueryBus\SymfonyQueryBus; |
127 | 126 | use Patchlevel\EventSourcingBundle\RequestListener\AutoSetupListener; |
128 | 127 | use Patchlevel\EventSourcingBundle\RequestListener\SubscriptionRebuildAfterFileChangeListener; |
| 128 | +use Patchlevel\EventSourcingBundle\Subscription\Engine\GapResolverMessageLoaderFactory; |
129 | 129 | use Patchlevel\EventSourcingBundle\Subscription\ResetServicesListener; |
130 | 130 | use Patchlevel\EventSourcingBundle\Subscription\StaticInMemorySubscriptionStoreFactory; |
131 | 131 | use Patchlevel\EventSourcingBundle\ValueResolver\AggregateRootIdValueResolver; |
@@ -354,11 +354,12 @@ private function configureMessageLoader(array $config, ContainerBuilder $contain |
354 | 354 | } |
355 | 355 |
|
356 | 356 | $container->register(GapResolverStoreMessageLoader::class) |
| 357 | + ->setFactory([GapResolverMessageLoaderFactory::class, 'create']) |
357 | 358 | ->setArguments([ |
358 | 359 | new Reference(Store::class), |
359 | 360 | new Reference('event_sourcing.clock'), |
360 | 361 | $config['subscription']['gap_detection']['retries_in_ms'], |
361 | | - new DateInterval($config['subscription']['gap_detection']['detection_window']), |
| 362 | + $config['subscription']['gap_detection']['detection_window'], |
362 | 363 | ]); |
363 | 364 |
|
364 | 365 | $container->setAlias(MessageLoader::class, GapResolverStoreMessageLoader::class); |
@@ -1068,7 +1069,8 @@ private function configureClock(array $config, ContainerBuilder $container): voi |
1068 | 1069 | { |
1069 | 1070 | if ($config['clock']['freeze'] !== null) { |
1070 | 1071 | $container->register(FrozenClock::class) |
1071 | | - ->setArguments([new DateTimeImmutable($config['clock']['freeze'])]); |
| 1072 | + ->setFactory([FrozenClockFactory::class, 'create']) |
| 1073 | + ->setArguments([$config['clock']['freeze']]); |
1072 | 1074 |
|
1073 | 1075 | $container->setAlias('event_sourcing.clock', FrozenClock::class); |
1074 | 1076 |
|
|
0 commit comments