Beispiel #1
0
        /// <summary>
        /// Stock Method
        /// </summary>
        private async void StockErrorLogInfo()
        {
            var logInfoDataAccess = new LogInfoDataAccess();
            var cacheKey          = AppConfigurationHelper.GetAppSettings <CacheLogModel>("AppSettings:ErrorLogCache");

            cacheKey = string.IsNullOrEmpty(cacheKey?.Cachekey) ? new CacheLogModel {
                Cachekey = "ErrorLogCache", DatabaseNumber = 1
            } : cacheKey;
            long cacheListLength = RedisCacheHelper.GetListLength(cacheKey.Cachekey, cacheKey.DatabaseNumber);

            while (cacheListLength > 0)
            {
                var cacheModel = RedisCacheHelper.GetLastOneList <ErrorInfoLogModel>(cacheKey.Cachekey,
                                                                                     cacheKey.DatabaseNumber);
                await logInfoDataAccess.AddLogInfoAsync(cacheModel);

                cacheListLength = RedisCacheHelper.GetListLength(cacheKey.Cachekey, cacheKey.DatabaseNumber);
            }
        }