refine idle conv
This commit is contained in:
parent
43eb549bd0
commit
c5c2117fd0
|
|
@ -507,12 +507,13 @@ namespace BotSharp.Core.Repository
|
|||
continue;
|
||||
}
|
||||
|
||||
if (excludeAgentIds.Contains(conv.AgentId) || conv.UpdatedTime > utcNow.AddHours(-bufferHours))
|
||||
if (conv.UpdatedTime > utcNow.AddHours(-bufferHours))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (conv.DialogCount <= messageLimit)
|
||||
if ((excludeAgentIds.Contains(conv.AgentId) && conv.DialogCount == 0)
|
||||
|| (!excludeAgentIds.Contains(conv.AgentId) && conv.DialogCount <= messageLimit))
|
||||
{
|
||||
ids.Add(conv.Id);
|
||||
if (ids.Count >= batchSize)
|
||||
|
|
|
|||
|
|
@ -455,7 +455,9 @@ public partial class MongoRepository
|
|||
{
|
||||
var skip = (page - 1) * batchSize;
|
||||
var candidates = _dc.Conversations.AsQueryable()
|
||||
.Where(x => !excludeAgentIds.Contains(x.AgentId) && x.DialogCount <= messageLimit && x.UpdatedTime <= utcNow.AddHours(-bufferHours))
|
||||
.Where(x => ((!excludeAgentIds.Contains(x.AgentId) && x.DialogCount <= messageLimit)
|
||||
|| (excludeAgentIds.Contains(x.AgentId) && x.DialogCount == 0))
|
||||
&& x.UpdatedTime <= utcNow.AddHours(-bufferHours))
|
||||
.Skip(skip)
|
||||
.Take(batchSize)
|
||||
.Select(x => x.Id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue