瀏覽代碼

Fix that Version doesn't match (#253)

master
keke 6 年之前
committed by Savorboard
父節點
當前提交
3719c92224
共有 2 個檔案被更改,包括 10 行新增10 行删除
  1. +6
    -6
      src/DotNetCore.CAP.MongoDB/ICollectProcessor.MongoDB.cs
  2. +4
    -4
      src/DotNetCore.CAP.MongoDB/IStorageTransaction.MongoDB.cs

+ 6
- 6
src/DotNetCore.CAP.MongoDB/ICollectProcessor.MongoDB.cs 查看文件

@@ -31,18 +31,18 @@ namespace DotNetCore.CAP.MongoDB
_logger.LogDebug(
$"Collecting expired data from collection [{_options.PublishedCollection}].");

var publishedCollection = _database.GetCollection<CapPublishedMessage>(_options.PublishedCollection);
var receivedCollection = _database.GetCollection<CapReceivedMessage>(_options.ReceivedCollection);
var publishedCollection = _database.GetCollection<PublishedMessage>(_options.PublishedCollection);
var receivedCollection = _database.GetCollection<ReceivedMessage>(_options.ReceivedCollection);

await publishedCollection.BulkWriteAsync(new[]
{
new DeleteManyModel<CapPublishedMessage>(
Builders<CapPublishedMessage>.Filter.Lt(x => x.ExpiresAt, DateTime.Now))
new DeleteManyModel<PublishedMessage>(
Builders<PublishedMessage>.Filter.Lt(x => x.ExpiresAt, DateTime.Now))
});
await receivedCollection.BulkWriteAsync(new[]
{
new DeleteManyModel<CapReceivedMessage>(
Builders<CapReceivedMessage>.Filter.Lt(x => x.ExpiresAt, DateTime.Now))
new DeleteManyModel<ReceivedMessage>(
Builders<ReceivedMessage>.Filter.Lt(x => x.ExpiresAt, DateTime.Now))
});

await context.WaitAsync(_waitingInterval);


+ 4
- 4
src/DotNetCore.CAP.MongoDB/IStorageTransaction.MongoDB.cs 查看文件

@@ -39,9 +39,9 @@ namespace DotNetCore.CAP.MongoDB
throw new ArgumentNullException(nameof(message));
}

var collection = _database.GetCollection<CapPublishedMessage>(_options.PublishedCollection);
var collection = _database.GetCollection<PublishedMessage>(_options.PublishedCollection);

var updateDef = Builders<CapPublishedMessage>.Update
var updateDef = Builders<PublishedMessage>.Update
.Set(x => x.Retries, message.Retries)
.Set(x => x.Content, message.Content)
.Set(x => x.ExpiresAt, message.ExpiresAt)
@@ -57,9 +57,9 @@ namespace DotNetCore.CAP.MongoDB
throw new ArgumentNullException(nameof(message));
}

var collection = _database.GetCollection<CapReceivedMessage>(_options.ReceivedCollection);
var collection = _database.GetCollection<ReceivedMessage>(_options.ReceivedCollection);

var updateDef = Builders<CapReceivedMessage>.Update
var updateDef = Builders<ReceivedMessage>.Update
.Set(x => x.Retries, message.Retries)
.Set(x => x.Content, message.Content)
.Set(x => x.ExpiresAt, message.ExpiresAt)


Loading…
取消
儲存