예제 #1
0
        /// <summary>
        /// 每天的任务
        /// </summary>
        public void EverydayJob()
        {
            CommonHelper.IPErrorTimes.RemoveWhere(kv => kv.Value < 100); //将访客访问出错次数少于100的移开
            DateTime time = DateTime.Now.AddMonths(-1);

            _searchDetailsService.DeleteEntitySaved(s => s.SearchTime < time);
            TrackData.DumpLog();
        }
예제 #2
0
        /// <summary>
        /// 每天的任务
        /// </summary>
        public void EverydayJob()
        {
            CommonHelper.IPErrorTimes.RemoveWhere(kv => kv.Value < 100); //将访客访问出错次数少于100的移开
            RedisHelper.IncrBy("Interview:RunningDays");
            DateTime time = DateTime.Now.AddMonths(-1);

            _searchDetailsService.DeleteEntitySaved(s => s.SearchTime < time);
        }
예제 #3
0
        /// <summary>
        /// 每天的任务
        /// </summary>
        public void EverydayJob()
        {
            CommonHelper.IPErrorTimes.RemoveWhere(kv => kv.Value < 100);                      //将访客访问出错次数少于100的移开
            RedisHelper.Set("ArticleViewToken", SnowFlake.GetInstance().GetUniqueShortId(6)); //更新加密文章的密码
            RedisHelper.IncrBy("Interview:RunningDays");
            DateTime time = DateTime.Now.AddMonths(-1);

            _searchDetailsService.DeleteEntitySaved(s => s.SearchTime < time);
        }
예제 #4
0
        /// <summary>
        /// 每天的任务
        /// </summary>
        public void EverydayJob()
        {
            CommonHelper.IPErrorTimes.RemoveWhere(kv => kv.Value < 100); //将访客访问出错次数少于100的移开
            DateTime time = DateTime.Now.AddMonths(-1);

            _searchDetailsService.DeleteEntitySaved(s => s.SearchTime < time);
            TrackData.DumpLog();
            _advertisementService.GetQuery(a => DateTime.Now >= a.ExpireTime).UpdateFromQuery(a => new Advertisement()
            {
                Status = Status.Unavailable
            });
        }
예제 #5
0
        /// <summary>
        /// 每天的任务
        /// </summary>
        public void EverydayJob()
        {
            CommonHelper.IPErrorTimes.RemoveWhere(kv => kv.Value < 100);                      //将访客访问出错次数少于100的移开
            RedisHelper.Set("ArticleViewToken", SnowFlake.GetInstance().GetUniqueShortId(6)); //更新加密文章的密码
            RedisHelper.IncrBy("Interview:RunningDays");
            DateTime time = DateTime.Now.AddMonths(-1);

            _searchDetailsService.DeleteEntitySaved(s => s.SearchTime < time);
            foreach (var p in _postService.GetAll().AsParallel())
            {
                try
                {
                    p.AverageViewCount = p.PostAccessRecord.Average(r => r.ClickCount);
                    p.TotalViewCount   = p.PostAccessRecord.Sum(r => r.ClickCount);
                    _postService.UpdateEntity(p);
                    _postService.SaveChanges();
                }
                catch (Exception)
                {
                }
            }
        }
예제 #6
0
        /// <summary>
        /// 每天的任务
        /// </summary>
        public void EverydayJob()
        {
            CommonHelper.IPErrorTimes.RemoveWhere(kv => kv.Value < 100); //将访客访问出错次数少于100的移开
            DateTime time = DateTime.Now.AddMonths(-1);

            _searchDetailsService.DeleteEntitySaved(s => s.SearchTime < time);
            TrackData.DumpLog();
            _advertisementService.GetQuery(a => DateTime.Now >= a.ExpireTime).UpdateFromQuery(a => new Advertisement()
            {
                Status = Status.Unavailable
            });
            _noticeService.GetQuery(n => n.NoticeStatus == NoticeStatus.UnStart && n.StartTime < DateTime.Now).UpdateFromQuery(n => new Notice()
            {
                NoticeStatus = NoticeStatus.Normal,
                PostDate     = DateTime.Now,
                ModifyDate   = DateTime.Now
            });
            _noticeService.GetQuery(n => n.NoticeStatus == NoticeStatus.Normal && n.EndTime < DateTime.Now).UpdateFromQuery(n => new Notice()
            {
                NoticeStatus = NoticeStatus.Expired,
                ModifyDate   = DateTime.Now
            });
        }