|
|
@ -39,7 +39,7 @@ public class InventoryActor : Actor, IInventoryActor |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
await TryRegisterFlashSalesPersistInventoryTimerAsync(); |
|
|
await TryStartIntervalPersistInventoryAsync(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -55,11 +55,11 @@ public class InventoryActor : Actor, IInventoryActor |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
await TryRegisterFlashSalesPersistInventoryTimerAsync(); |
|
|
await TryStartIntervalPersistInventoryAsync(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected virtual async Task TryRegisterFlashSalesPersistInventoryTimerAsync() |
|
|
protected virtual async Task TryStartIntervalPersistInventoryAsync() |
|
|
{ |
|
|
{ |
|
|
if (FlashSalesInventoryUpdated) |
|
|
if (FlashSalesInventoryUpdated) |
|
|
{ |
|
|
{ |
|
|
@ -68,6 +68,8 @@ public class InventoryActor : Actor, IInventoryActor |
|
|
|
|
|
|
|
|
FlashSalesInventoryUpdated = true; |
|
|
FlashSalesInventoryUpdated = true; |
|
|
|
|
|
|
|
|
|
|
|
await SetInventoryStateAsync(await GetInventoryStateAsync()); |
|
|
|
|
|
|
|
|
await RegisterTimerAsync(null, nameof(TimerSetInventoryStateAsync), null, TimeSpan.FromSeconds(5), |
|
|
await RegisterTimerAsync(null, nameof(TimerSetInventoryStateAsync), null, TimeSpan.FromSeconds(5), |
|
|
TimeSpan.FromMilliseconds(-1)); |
|
|
TimeSpan.FromMilliseconds(-1)); |
|
|
} |
|
|
} |
|
|
|