Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed usage of CreateIndexes for mongo #1287

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class MongoPersistenceProvider : IPersistenceProvider
public MongoPersistenceProvider(IMongoDatabase database)
{
_database = database;
CreateIndexes(this);
}

static MongoPersistenceProvider()
Expand Down Expand Up @@ -263,7 +262,7 @@ public async Task ClearSubscriptionToken(string eventSubscriptionId, string toke

public void EnsureStoreExists()
{

CreateIndexes(this);
}

public async Task<IEnumerable<EventSubscription>> GetSubscriptions(string eventName, string eventKey, DateTime asOf, CancellationToken cancellationToken = default)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MongoDB.Driver;
using System;
using WorkflowCore.Interface;
using WorkflowCore.Persistence.MongoDB.Services;
using WorkflowCore.UnitTests;
Expand All @@ -23,7 +22,9 @@ protected override IPersistenceProvider Subject
{
var client = new MongoClient(MongoDockerSetup.ConnectionString);
var db = client.GetDatabase(nameof(MongoPersistenceProviderFixture));
return new MongoPersistenceProvider(db);
var provider = new MongoPersistenceProvider(db);
provider.EnsureStoreExists();
return provider;
}
}
}
Expand Down
Loading