Skip to content

Commit

Permalink
fix typo in PersistanceFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Revazashvili committed May 26, 2024
1 parent a761d78 commit 4f75c7a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/WorkflowCore/Models/WorkflowOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace WorkflowCore.Models
{
public class WorkflowOptions
{
internal Func<IServiceProvider, IPersistenceProvider> PersistanceFactory;
internal Func<IServiceProvider, IPersistenceProvider> PersistenceFactory;
internal Func<IServiceProvider, IQueueProvider> QueueFactory;
internal Func<IServiceProvider, IDistributedLockProvider> LockFactory;
internal Func<IServiceProvider, ILifeCycleEventHub> EventHubFactory;
Expand All @@ -29,7 +29,7 @@ public WorkflowOptions(IServiceCollection services)

QueueFactory = new Func<IServiceProvider, IQueueProvider>(sp => new SingleNodeQueueProvider());
LockFactory = new Func<IServiceProvider, IDistributedLockProvider>(sp => new SingleNodeLockProvider());
PersistanceFactory = new Func<IServiceProvider, IPersistenceProvider>(sp => new TransientMemoryPersistenceProvider(sp.GetService<ISingletonMemoryProvider>()));
PersistenceFactory = new Func<IServiceProvider, IPersistenceProvider>(sp => new TransientMemoryPersistenceProvider(sp.GetService<ISingletonMemoryProvider>()));
SearchIndexFactory = new Func<IServiceProvider, ISearchIndex>(sp => new NullSearchIndex());
EventHubFactory = new Func<IServiceProvider, ILifeCycleEventHub>(sp => new SingleNodeEventHub(sp.GetService<ILoggerFactory>()));
}
Expand All @@ -42,7 +42,7 @@ public WorkflowOptions(IServiceCollection services)

public void UsePersistence(Func<IServiceProvider, IPersistenceProvider> factory)
{
PersistanceFactory = factory;
PersistenceFactory = factory;
}

public void UseDistributedLockManager(Func<IServiceProvider, IDistributedLockProvider> factory)
Expand Down
8 changes: 4 additions & 4 deletions src/WorkflowCore/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public static IServiceCollection AddWorkflow(this IServiceCollection services, A
var options = new WorkflowOptions(services);
setupAction?.Invoke(options);
services.AddSingleton<ISingletonMemoryProvider, MemoryPersistenceProvider>();
services.AddTransient<IPersistenceProvider>(options.PersistanceFactory);
services.AddTransient<IWorkflowRepository>(options.PersistanceFactory);
services.AddTransient<ISubscriptionRepository>(options.PersistanceFactory);
services.AddTransient<IEventRepository>(options.PersistanceFactory);
services.AddTransient<IPersistenceProvider>(options.PersistenceFactory);
services.AddTransient<IWorkflowRepository>(options.PersistenceFactory);
services.AddTransient<ISubscriptionRepository>(options.PersistenceFactory);
services.AddTransient<IEventRepository>(options.PersistenceFactory);
services.AddSingleton<IQueueProvider>(options.QueueFactory);
services.AddSingleton<IDistributedLockProvider>(options.LockFactory);
services.AddSingleton<ILifeCycleEventHub>(options.EventHubFactory);
Expand Down

0 comments on commit 4f75c7a

Please sign in to comment.