Skip to content

Commit

Permalink
Merge pull request #1287 from SamhammerAG/fix-mongo
Browse files Browse the repository at this point in the history
Fixed usage of CreateIndexes for mongo
  • Loading branch information
danielgerlag authored Nov 15, 2024
2 parents db61af3 + 0b51d8e commit 746bb65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 746bb65

Please sign in to comment.