与任务执行,新增信号量锁,解决并发环境下数据的一致性问题

This commit is contained in:
yang.lee
2023-11-03 22:12:01 +08:00
parent 669c4228e8
commit 537e54b565
5 changed files with 61 additions and 28 deletions

View File

@@ -54,8 +54,10 @@ namespace Tnb.WarehouseMgr
public class BaseWareHouseService : IOverideVisualDevService, IDynamicApiController, ITransient
{
private static Lazy<Dictionary<string, IWHStorageService>> _stroageMapLazy;
private static Dictionary<string, IWHStorageService> _storeMap = new(StringComparer.OrdinalIgnoreCase);
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
public static SemaphoreSlim s_taskExecuteSemaphore = new SemaphoreSlim(1);
private IEventPublisher _eventPublisher;
@@ -68,10 +70,6 @@ namespace Tnb.WarehouseMgr
/*public BaseWareHouseService(ChannelWriter<NotifyMessage>? channelWriter = default)
{
_channelWriter = channelWriter;
}*/
static BaseWareHouseService()
{