public void LogEndInfo(JobEndInfo job) { if (!job.Name.Contains(nameof(GetEventSettingsAsync))) { _logger.LogInformation(" - Ended: {name}, was executed: {duration}", job.Name, job.Duration); } }
private void FluentJobEnd(JobEndInfo info) { if (_dataService.RSettings.ProgramSettings.Debug) { _ = _log.LogMessage($"FLUENT JOB ENDED:{info.Name}", false, color: LOG_COLOR); } }
private static void JobManagerOnJobEnd(JobEndInfo obj) { if (obj.Name.Equals("ConsoleUpdater", StringComparison.OrdinalIgnoreCase)) { return; } Logger.Trace($"A job has ended -> {obj.Name} / {obj.StartTime.ToString()}"); }
public void UpdateForEnded(JobEndInfo info) { IsRunning = false; StartTime = info.StartTime; Duration = info.Duration; if (info.NextRun != null) { NextRun = info.NextRun.Value; } }
private static void JobManager_JobEnd(JobEndInfo obj) { if (obj.Name == "lala") { Console.WriteLine("good"); } else if (obj.Name == "lala2") { Console.WriteLine("lala2"); } else { Console.WriteLine("bad"); } }
private void JobManager_JobEnd(JobEndInfo obj) { if (JobManager.GetSchedule(obj.Name) == null) { return; } using (IDbContext dbContext = _dbContextFactory.Create()) { JobDefinition jobDefinition = dbContext.Set <JobDefinition>().SingleOrDefault(jobDef => jobDef.Name == obj.Name); jobDefinition.LastExecutionTime = DateTime.UtcNow; jobDefinition.JobStatus = JobStatus.Finished; dbContext.Entry(jobDefinition).State = EntityState.Modified; dbContext.SaveChanges(); this._logger.Debug(string.Format("Execution of job {0} took {1} msecs.", obj.Name, (long)obj.Duration.TotalMilliseconds)); } }
private static void JobManager_JobEnd(JobEndInfo obj) { Logger.Information($"Finished job '{obj.Name}'."); }
/// <summary> /// Passthrough event handler for <see cref="OnJobEnd"/>. /// </summary> /// <param name="obj">The <see cref="JobEndInfo"/>.</param> private static void JobManager_JobEnd(JobEndInfo obj) => OnJobEnd?.Invoke(null, obj);
/// <summary> /// 任务执行结束事件 /// </summary> /// <param name="endInfo"></param> public void JobEnd(JobEndInfo endInfo) { string content = string.Format("任务结束执行事件:方法名称:{0};结束执行时间:{1};运行持续时间:{2};下次运行时间:{3}。", endInfo.Name, endInfo.StartTime.ToString("yyyy-MM-dd HH:mm:ss"), endInfo.Duration.TotalMilliseconds, (endInfo.NextRun.HasValue ? endInfo.NextRun.Value.ToString("yyyy-MM-dd HH:mm:ss") : "")); Log(content); }
private static void JobManager_JobEnd(JobEndInfo obj) { Refresh(); }
public void JobEndHandler(JobEndInfo info) { GetSchedulerDashboardModel(info.Name)?.UpdateForEnded(info); _logger.LogInformation($"{info.Name}: ended ({info.Duration})"); }
internal static void JobEndedEventHandler(JobEndInfo arg) { Console.WriteLine($"[JOB] Job {arg.Name} was completed (ran for {arg.Duration.TotalSeconds} seconds)"); }
public static void OnJobEnd(JobEndInfo obj) { switch (obj.Name) { case "CreateDailyReport1": case "CreateDailyReport2": case "CreateDailyReport3": case "CreateDailyReport4": case "CreateDailyReport5": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},12点定时任务--生成统计报表完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},12点定时任务--生成统计报表完毕..."); break; case "CreateReport6": case "CreateReport7": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},19点定时任务--生成统计报表完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},19点定时任务--生成统计报表完毕..."); break; case "PushDailyReport1": case "PushDailyReport2": case "PushDailyReport3": case "PushDailyReport4": case "PushDailyReport5": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},每天14点定时报表推送完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},每天14点定时报表推送完毕..."); break; case "PushDailyReport6": case "PushDailyReport7": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},每天20点定时报表推送完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},每天20点定时报表推送完毕..."); break; case "PushWeeklyReport": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},每周一15点定时周报表推送完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},每周一15点定时周报表推送完毕..."); break; case "PushMonthlyReport": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},每月一号16点定时月报表推送完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},每月一号16点定时月报表推送完毕..."); break; case "CreateRepeatReport": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},每天19点定时历史报表生成完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},每天19点定时历史报表生成完毕..."); break; case "ImportErpToOMS": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},每天21点定时ERP订单导入解析完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},每天21点定时ERP订单导入解析完毕..."); break; case "CreateReport2": WxPushNews.SendErrorText($"当前时间:{DateTime.Now},每天23点定时任务--生成统计报表完毕..."); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},每天23点定时任务..."); break; default: WxPushNews.SendErrorText($"当前时间:{DateTime.Now},任务名称{obj.Name}执行完毕"); Util.Logs.Log.GetLog(nameof(PushJob)).Info($"当前时间:{DateTime.Now},任务名称{obj.Name}执行完毕"); break; } }