/// <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(); }
/// <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); }
/// <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); }
/// <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 }); }
/// <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) { } } }
/// <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 }); }