临时提交
This commit is contained in:
parent
8f0f40cc56
commit
f50dccebe8
@ -9,6 +9,14 @@ public interface ITrackPushCacheService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<bool> IsPushAsync(int customId);
|
Task<bool> IsPushAsync(int customId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 判断客户是否需要推送
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="subSystemId"></param>
|
||||||
|
/// <param name="customId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> IsPushAsync(int subSystemId, int customId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新缓存
|
/// 更新缓存
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -99,7 +99,8 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
};
|
};
|
||||||
|
|
||||||
// todo:推送只做新增的,更新和删除的不做先
|
// todo:推送只做新增的,更新和删除的不做先
|
||||||
if (!@event.IsPushCompleted && await _trackPushCacheService.IsPushAsync(@event.CustomId))
|
if (!@event.IsPushCompleted &&
|
||||||
|
await _trackPushCacheService.IsPushAsync(@event.SubSystemId, @event.CustomId))
|
||||||
{
|
{
|
||||||
//await PushTrack();
|
//await PushTrack();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,21 @@ public class TrackPushCacheService : ITrackPushCacheService, ITransientDependenc
|
|||||||
return (bool)isPush;
|
return (bool)isPush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> IsPushAsync(int subSystemId, int customId)
|
||||||
|
{
|
||||||
|
var isPush =
|
||||||
|
await RedisHelper.Client.GetAsync<bool?>(RedisKey(customId));
|
||||||
|
|
||||||
|
if (isPush == null)
|
||||||
|
{
|
||||||
|
isPush = await _trackPushConfigQuery.GetFirstAsync(x => x.CustomId == customId,
|
||||||
|
x => x.IsAutoPush);
|
||||||
|
await RedisHelper.Client.SetAsync(RedisKey(customId), isPush);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (bool)isPush;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task UpdateAsync(int customId, bool isPush)
|
public async Task UpdateAsync(int customId, bool isPush)
|
||||||
{
|
{
|
||||||
await RedisHelper.Client.SetAsync(RedisKey(customId), isPush);
|
await RedisHelper.Client.SetAsync(RedisKey(customId), isPush);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user