minor change
This commit is contained in:
parent
b547ff1665
commit
c04e60b218
|
|
@ -270,6 +270,7 @@ namespace BotSharp.Core.Repository
|
|||
{
|
||||
var ids = new List<string>();
|
||||
var batchLimit = 50;
|
||||
var utcNow = DateTime.UtcNow;
|
||||
var dir = Path.Combine(_dbSettings.FileRepository, _conversationSettings.DataDir);
|
||||
|
||||
if (batchSize <= 0 || batchSize > batchLimit)
|
||||
|
|
@ -287,7 +288,7 @@ namespace BotSharp.Core.Repository
|
|||
|
||||
var json = File.ReadAllText(convFile);
|
||||
var conv = JsonSerializer.Deserialize<Conversation>(json, _options);
|
||||
if (conv == null || conv.CreatedTime > DateTime.UtcNow.AddHours(-bufferHours))
|
||||
if (conv == null || conv.CreatedTime > utcNow.AddHours(-bufferHours))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@ public partial class MongoRepository
|
|||
{
|
||||
var page = 1;
|
||||
var batchLimit = 50;
|
||||
var utcNow = DateTime.UtcNow;
|
||||
var conversationIds = new List<string>();
|
||||
|
||||
if (batchSize <= 0 || batchSize > batchLimit)
|
||||
|
|
@ -288,7 +289,7 @@ public partial class MongoRepository
|
|||
{
|
||||
var skip = (page - 1) * batchSize;
|
||||
var candidates = _dc.Conversations.AsQueryable()
|
||||
.Where(x => x.CreatedTime <= DateTime.UtcNow.AddHours(-bufferHours))
|
||||
.Where(x => x.CreatedTime <= utcNow.AddHours(-bufferHours))
|
||||
.Skip(skip)
|
||||
.Take(batchSize)
|
||||
.Select(x => x.Id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue