public override string Register() { try { JobId = BackgroundJob.Enqueue(() => Trigger(this)); Nlogger.Info($"The [{JobId}] added to hangfire fire and forget jobs successful."); return(JobId); } catch (Exception exp) { Nlogger.Fatal(exp); return(exp.Message); } }
public override string Register() { try { JobId = BackgroundJob.Schedule(() => Trigger(this), TriggerOn); Nlogger.Info($"The [{JobId}] added to hangfire delayed jobs successful."); return(JobId); } catch (Exception exp) { Nlogger.Fatal(exp); return(exp.Message); } }
public override string Register() { try { JobId = $"{Name ?? ActionName}: {DateTime.Now.GetHashCode()}"; RecurringJob.AddOrUpdate(JobId, () => Trigger(this), TriggerOn, TimeZoneInfo.Local); Nlogger.Info($"The [{JobId}] added to hangfire recurring jobs successful."); return(JobId); } catch (Exception exp) { Nlogger.Fatal(exp); return(exp.Message); } }
/// <summary> /// 记录Info级日志 /// </summary> /// <param name="err">程序异常</param> /// <param name="msg">格式化消息</param> /// <param name="args">格式参数</param> public void Info(Exception err, string msg, params object[] args) => Nlogger.Info(err, msg, args);
/// <summary> /// 记录Info级日志 /// </summary> /// <param name="msg">格式化消息</param> /// <param name="args">格式参数</param> public void Info(string msg, params object[] args) => Nlogger.Info(msg, args);