@@ -59,7 +59,7 @@ bool MPCService::addJobIfNotRunning(const JobInfo& jobInfo)
5959 << LOG_KV (" code" , it->second .code )
6060 << LOG_KV (" message" , it->second .message );
6161
62- if (it->second .code == MPC_RUNNING )
62+ if (it->second .status == MPC_JOB_RUNNNING )
6363 {
6464 // job is running
6565 return false ;
@@ -70,7 +70,7 @@ bool MPCService::addJobIfNotRunning(const JobInfo& jobInfo)
7070
7171 JobStatus jobStatus;
7272 jobStatus.jobId = jobInfo.jobId ;
73- jobStatus.code = MPC_RUNNING ;
73+ jobStatus.status = MPC_JOB_RUNNNING ;
7474 jobStatus.message = " job is running" ;
7575 jobStatus.startTimeMs = utcSteadyTime ();
7676 jobStatus.timeCostMs = 0 ;
@@ -123,7 +123,7 @@ void MPCService::onSuccess(const std::string &jobId, const std::string &msg)
123123 }
124124
125125 JobStatus &jobStatus = it->second ;
126- jobStatus.code = MPC_SUCCESS ;
126+ jobStatus.status = MPC_JOB_COMPLETED ;
127127 jobStatus.message = msg;
128128 jobStatus.timeCostMs = utcSteadyTime () - jobStatus.startTimeMs ;
129129
@@ -148,7 +148,7 @@ void MPCService::onFailed(const std::string &jobId, const std::string &msg)
148148 }
149149
150150 JobStatus &jobStatus = it->second ;
151- jobStatus.code = MPC_FAILED ;
151+ jobStatus.status = MPC_JOB_FAILED ;
152152 jobStatus.message = msg;
153153 jobStatus.timeCostMs = utcSteadyTime () - jobStatus.startTimeMs ;
154154
@@ -173,7 +173,7 @@ void MPCService::onKill(const std::string &jobId, const std::string &msg)
173173 }
174174
175175 JobStatus &jobStatus = it->second ;
176- jobStatus.code = MPC_KILLED ;
176+ jobStatus.status = MPC_JOB_KILLED ;
177177 jobStatus.message = msg;
178178 jobStatus.timeCostMs = utcSteadyTime () - jobStatus.startTimeMs ;
179179
@@ -268,13 +268,15 @@ void MPCService::queryMpcRpc(Json::Value const& request, RespFunc func)
268268 Json::Value response;
269269 if (result)
270270 {
271- response[" code" ] = jobStatus.code ;
271+ response[" code" ] = MPC_SUCCESS;
272+ response[" status" ] = jobStatus.status ;
272273 response[" message" ] = jobStatus.message ;
273274 response[" timeCostMs" ] = jobStatus.timeCostMs ;
274275 }
275276 else
276277 {
277278 response[" code" ] = MPC_FAILED;
279+ response[" status" ] = " " ;
278280 response[" message" ] = " job does not exist" ;
279281 response[" timeCostMs" ] = -1 ;
280282 }
0 commit comments