Browse Source

Remove history expiration.

pull/492/head
Sebastian 6 years ago
parent
commit
4cc0369aac
  1. 12
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/History/MongoHistoryEventRepository.cs

12
backend/src/Squidex.Domain.Apps.Entities.MongoDb/History/MongoHistoryEventRepository.cs

@ -42,22 +42,14 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.History
protected override Task SetupCollectionAsync(IMongoCollection<HistoryEvent> collection, CancellationToken ct = default)
{
return collection.Indexes.CreateManyAsync(new[]
{
return collection.Indexes.CreateOneAsync(
new CreateIndexModel<HistoryEvent>(
Index
.Ascending(x => x.AppId)
.Ascending(x => x.Channel)
.Descending(x => x.Created)
.Descending(x => x.Version)),
new CreateIndexModel<HistoryEvent>(
Index
.Ascending(x => x.Created),
new CreateIndexOptions
{
ExpireAfter = TimeSpan.FromDays(365)
})
}, ct);
cancellationToken: ct);
}
public async Task<IReadOnlyList<HistoryEvent>> QueryByChannelAsync(Guid appId, string channelPrefix, int count)

Loading…
Cancel
Save