private void RunOnceExec() { try { RunGuid = Guid.NewGuid().ToString().Replace("-", ""); Ruanal.Core.ApiSdk.SystemApi.TaskBeginRunLog(TaskId, RunGuid, Core.ApiSdk.TaskRunType.DoDispatch); _dispatchbase.GetDispatchs(); IsRunning = true; Ruanal.Core.ApiSdk.SystemApi.TaskEndRunLog(TaskId, RunGuid, true, ""); } catch (Exception ex) { Ruanal.Core.ApiSdk.SystemApi.TaskEndRunLog(TaskId, RunGuid, false, ex.Message); IsRunning = false; } }
public void Execute(JobContext context) { if (IsRunning) { return; } IsRunning = true; RunGuid = Guid.NewGuid().ToString().Replace("-", ""); Ruanal.Core.ApiSdk.SystemApi.TaskBeginRunLog(TaskId, RunGuid, Core.ApiSdk.TaskRunType.DoDispatch); var dispatchconfigs = _dispatchbase.GetDispatchs(); var t_groupId = Guid.NewGuid().ToString().Replace("-", ""); var result = Ruanal.Core.ApiSdk.TaskApi.BuildDispatch(TaskId, t_groupId, dispatchconfigs); if (result.code <= 0) { IsRunning = false; } else { GroupId = t_groupId; CheckState(); } }