/// <summary> /// 运行程序 /// </summary> /// <param name="arguments">程序运行的参数</param> public void Run(params string[] arguments) { if (ExecuteRecord == null && !string.IsNullOrWhiteSpace(Env.HubServiceUrl)) { ExecuteRecord = new HttpExecuteRecord(); } if (ExecuteRecord != null) { ExecuteRecord.Logger = Logger; } if (!AddExecuteRecord()) { Logger.Error($"Can not add execute record: {Identity}."); } try { Execute(arguments); } finally { ExecuteRecord?.Remove(TaskId, Name, Identity); } }
private bool AddExecuteRecord() { if (ExecuteRecord == null && !string.IsNullOrEmpty(Env.HttpCenter)) { ExecuteRecord = new HttpExecuteRecord(); } if (ExecuteRecord == null) { return(true); } else { return(ExecuteRecord.Add(TaskId, Name, Identity)); } }
/// <summary> /// 运行程序 /// </summary> /// <param name="arguments">程序运行的参数</param> public void Run(params string[] arguments) { if (ExecuteRecord == null && !string.IsNullOrWhiteSpace(Env.EnterpiseServiceUrl)) { ExecuteRecord = new HttpExecuteRecord(); } if (!AddExecuteRecord()) { Logger.Log(Identity, "Can not add execute record.", Level.Error); } try { Execute(arguments); } finally { ExecuteRecord?.Remove(TaskId, Name, Identity); } }
public void Run(params string[] arguments) { if (ExecuteRecord == null && !string.IsNullOrEmpty(Env.HttpCenter)) { ExecuteRecord = new HttpExecuteRecord(); } if (!AddExecuteRecord()) { Logger.AllLog(Identity, "Can not add execute record.", LogLevel.Error); } try { RunApp(arguments); } finally { RemoveExecuteRecord(); } }