Browse Source

Small fixes.

pull/585/head
Sebastian 5 years ago
parent
commit
292718333d
  1. 9
      backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs
  2. 2
      backend/src/Squidex.Infrastructure/Orleans/IBackgroundGrain.cs

9
backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore.cs

@ -9,6 +9,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MongoDB.Bson; using MongoDB.Bson;
using MongoDB.Driver; using MongoDB.Driver;
using MongoDB.Driver.Core.Clusters;
using Squidex.Infrastructure.MongoDb; using Squidex.Infrastructure.MongoDb;
namespace Squidex.Infrastructure.EventSourcing namespace Squidex.Infrastructure.EventSourcing
@ -31,7 +32,7 @@ namespace Squidex.Infrastructure.EventSourcing
get { return Collection; } get { return Collection; }
} }
public bool IsReplicaSet { get; } public bool IsReplicaSet { get; private set; }
public MongoEventStore(IMongoDatabase database, IEventNotifier notifier) public MongoEventStore(IMongoDatabase database, IEventNotifier notifier)
: base(database) : base(database)
@ -51,9 +52,9 @@ namespace Squidex.Infrastructure.EventSourcing
return new MongoCollectionSettings { WriteConcern = WriteConcern.WMajority }; return new MongoCollectionSettings { WriteConcern = WriteConcern.WMajority };
} }
protected override Task SetupCollectionAsync(IMongoCollection<MongoEventCommit> collection, CancellationToken ct = default) protected override async Task SetupCollectionAsync(IMongoCollection<MongoEventCommit> collection, CancellationToken ct = default)
{ {
return collection.Indexes.CreateManyAsync(new[] await collection.Indexes.CreateManyAsync(new[]
{ {
new CreateIndexModel<MongoEventCommit>( new CreateIndexModel<MongoEventCommit>(
Index Index
@ -75,6 +76,8 @@ namespace Squidex.Infrastructure.EventSourcing
Unique = true Unique = true
}) })
}, ct); }, ct);
IsReplicaSet = Database.Client.Cluster.Description.Type == ClusterType.ReplicaSet;
} }
} }
} }

2
backend/src/Squidex.Infrastructure/Orleans/IBackgroundGrain.cs

@ -7,13 +7,11 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Orleans; using Orleans;
using Orleans.Concurrency;
namespace Squidex.Infrastructure.Orleans namespace Squidex.Infrastructure.Orleans
{ {
public interface IBackgroundGrain : IGrainWithStringKey public interface IBackgroundGrain : IGrainWithStringKey
{ {
[OneWay]
Task ActivateAsync(); Task ActivateAsync();
} }
} }

Loading…
Cancel
Save