enh: refactor scheduler code
This commit is contained in:
parent
9e00672c60
commit
2f1cc7ae60
|
@ -41,6 +41,10 @@ SSchStatusFps gSchTaskFps[JOB_TASK_STATUS_MAX] = {
|
||||||
{JOB_TASK_STATUS_DROP, schTaskStatusNullEnter, schTaskStatusNullLeave, schTaskStatusNullEvent},
|
{JOB_TASK_STATUS_DROP, schTaskStatusNullEnter, schTaskStatusNullLeave, schTaskStatusNullEvent},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int32_t schSwitchJobStatus(int32_t status, SSchJob* pJob, void* pParam) {
|
||||||
|
schJobStatusEnter(pJob, status, pParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,14 @@ int32_t schedulerExecJob(SSchedulerReq *pReq, int64_t *pJobId) {
|
||||||
|
|
||||||
SCH_ERR_RET(schJobStatusEnter(&pJob, JOB_TASK_STATUS_INIT, pReq));
|
SCH_ERR_RET(schJobStatusEnter(&pJob, JOB_TASK_STATUS_INIT, pReq));
|
||||||
|
|
||||||
|
SSchEvent event = {0};
|
||||||
|
event.event = SCH_EVENT_BEGIN_OP;
|
||||||
|
SSchOpEvent opEvent = {0};
|
||||||
|
opEvent.type = SCH_OP_EXEC;
|
||||||
|
opEvent.begin = true;
|
||||||
|
opEvent.pReq = pReq;
|
||||||
|
schJobHandleEvent(pJob, &event);
|
||||||
|
|
||||||
SCH_ERR_RET(schJobStatusEnter(&pJob, JOB_TASK_STATUS_EXEC, pReq));
|
SCH_ERR_RET(schJobStatusEnter(&pJob, JOB_TASK_STATUS_EXEC, pReq));
|
||||||
|
|
||||||
*pJobId = pJob->refId;
|
*pJobId = pJob->refId;
|
||||||
|
|
Loading…
Reference in New Issue