wanshenmean
6 小时以前 bd40cc9e7dd6352915568ce49baa4accd1d9645b
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs
@@ -27,7 +27,10 @@
            (nameof(ConfigKey.RelocationFinishTask), "Task/RelocationFinishTask"),
            (nameof(ConfigKey.CreateRobotGroupPalletTask), "Task/CreateRobotGroupPalletTask"),
            (nameof(ConfigKey.CreateRobotChangePalletTask), "Task/CreateRobotChangePalletTask"),
            (nameof(ConfigKey.CreateRobotSplitPalletTask), "Task/CreateRobotSplitPalletTask")
            (nameof(ConfigKey.CreateRobotSplitPalletTask), "Task/CreateRobotSplitPalletTask"),
            (nameof(ConfigKey.OutboundFinishTaskTray), "Task/OutboundFinishTaskTray"),
            (nameof(ConfigKey.SplitPalletConfirm), "Stock/SplitPalletConfirm"),
            (nameof(ConfigKey.GroupPalletConfirm), "Stock/GroupPalletConfirm")
        };
        private readonly ICacheService _cache;
@@ -43,8 +46,16 @@
        public Task StartAsync(CancellationToken cancellationToken)
        {
            const string cacheKey = $"{RedisPrefix.Code}";
            _cache.RemoveByPrefix($"{cacheKey}");
            const string cacheKeyPrefix = $"{RedisPrefix.Code}:{RedisName.API}:";
            int warmedCount = 0;
            foreach ((string configKey, string routePath) in ApiRouteMappings)
            {
@@ -52,7 +63,7 @@
                warmedCount++;
            }
            _logger.LogInformation(":API路由缓存预热完成。计数={Count}", warmedCount);
            _logger.LogInformation("API路由缓存预热完成,共加载={Count}个路由映射", warmedCount);
            return Task.CompletedTask;
        }