优化定时任务发送
This commit is contained in:
parent
8334b5ee49
commit
69cad7bdee
@ -398,7 +398,8 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
{
|
||||
foreach (var ammerterItem in focusItem.Value)
|
||||
{
|
||||
_= _capBus.PublishAsync(ProtocolConst.AmmeterSubscriberWorkerFifteenMinuteIssuedEventName, ammerterItem.Value);
|
||||
//todo 可能需要优化,如果使用等待,会很慢,但使用不等待,mongodb 连接池又没法抗住,先发送微妙级的延时队列消息,暂时先这样处理
|
||||
_= _capBus.PublishDelayAsync(TimeSpan.FromMicroseconds(500), ProtocolConst.AmmeterSubscriberWorkerFifteenMinuteIssuedEventName, ammerterItem.Value);
|
||||
meterTaskInfosList.Add(ammerterItem.Value);
|
||||
}
|
||||
}
|
||||
@ -408,7 +409,7 @@ namespace JiShe.CollectBus.ScheduledMeterReading
|
||||
}
|
||||
|
||||
//删除任务数据
|
||||
await FreeRedisProvider.Instance.DelAsync(redisKeyList);
|
||||
await FreeRedisProvider.Instance.DelAsync(oneMinutekeyList);
|
||||
|
||||
//缓存下一个时间的任务
|
||||
TasksToBeIssueModel nextTask = new TasksToBeIssueModel()
|
||||
|
||||
@ -11,7 +11,7 @@ namespace JiShe.CollectBus.Common.Consts
|
||||
/// <summary>
|
||||
/// 缓存基础目录
|
||||
/// </summary>
|
||||
public const string CacheBasicDirectoryKey = "CollectBus";
|
||||
public const string CacheBasicDirectoryKey = "CollectBus:";
|
||||
|
||||
/// <summary>
|
||||
/// 1分钟采集间隔
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user