|
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; |
|
123 | 121 | use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberAccessorRepository; |
124 | 122 | use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberHelper; |
125 | 123 | use Patchlevel\EventSourcingBundle\Attribute\AsListener; |
| 124 | +use Patchlevel\EventSourcingBundle\Clock\FrozenClockFactory; |
126 | 125 | use Patchlevel\EventSourcingBundle\Command\StoreMigrateCommand; |
127 | 126 | use Patchlevel\EventSourcingBundle\CommandBus\SymfonyCommandBus; |
128 | 127 | use Patchlevel\EventSourcingBundle\DataCollector\EventSourcingCollector; |
|
132 | 131 | use Patchlevel\EventSourcingBundle\QueryBus\SymfonyQueryBus; |
133 | 132 | use Patchlevel\EventSourcingBundle\RequestListener\AutoSetupListener; |
134 | 133 | use Patchlevel\EventSourcingBundle\RequestListener\SubscriptionRebuildAfterFileChangeListener; |
| 134 | +use Patchlevel\EventSourcingBundle\Subscription\Engine\GapResolverMessageLoaderFactory; |
135 | 135 | use Patchlevel\EventSourcingBundle\Subscription\ResetServicesListener; |
136 | 136 | use Patchlevel\EventSourcingBundle\Subscription\StaticInMemorySubscriptionStoreFactory; |
137 | 137 | use Patchlevel\EventSourcingBundle\ValueResolver\IdentifierValueResolver; |
@@ -364,11 +364,12 @@ private function configureMessageLoader(array $config, ContainerBuilder $contain |
364 | 364 | } |
365 | 365 |
|
366 | 366 | $container->register(GapResolverStoreMessageLoader::class) |
| 367 | + ->setFactory([GapResolverMessageLoaderFactory::class, 'create']) |
367 | 368 | ->setArguments([ |
368 | 369 | new Reference(Store::class), |
369 | 370 | new Reference('event_sourcing.clock'), |
370 | 371 | $config['subscription']['gap_detection']['retries_in_ms'], |
371 | | - new DateInterval($config['subscription']['gap_detection']['detection_window']), |
| 372 | + $config['subscription']['gap_detection']['detection_window'], |
372 | 373 | ]); |
373 | 374 |
|
374 | 375 | $container->setAlias(MessageLoader::class, GapResolverStoreMessageLoader::class); |
@@ -1081,7 +1082,8 @@ private function configureClock(array $config, ContainerBuilder $container): voi |
1081 | 1082 | { |
1082 | 1083 | if ($config['clock']['freeze'] !== null) { |
1083 | 1084 | $container->register(FrozenClock::class) |
1084 | | - ->setArguments([new DateTimeImmutable($config['clock']['freeze'])]); |
| 1085 | + ->setFactory([FrozenClockFactory::class, 'create']) |
| 1086 | + ->setArguments([$config['clock']['freeze']]); |
1085 | 1087 |
|
1086 | 1088 | $container->setAlias('event_sourcing.clock', FrozenClock::class); |
1087 | 1089 |
|
|
0 commit comments