/// <summary>
        /// 每天的任务
        /// </summary>
        public void EverydayJob()
        {
            CommonHelper.IPErrorTimes.RemoveWhere(kv => kv.Value < 100); //将访客访问出错次数少于100的移开
            DateTime time = DateTime.Now.AddMonths(-1);
            var      searchDetailsService = _serviceScope.ServiceProvider.GetRequiredService <ISearchDetailsService>();
            var      advertisementService = _serviceScope.ServiceProvider.GetRequiredService <IAdvertisementService>();
            var      noticeService        = _serviceScope.ServiceProvider.GetRequiredService <INoticeService>();

            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
            });
        }
Exemple #2
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();
        }
Exemple #3
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
            });
        }