Skip to content

Commit

Permalink
mxq_job: Make status change from assigned to running invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Jul 26, 2015
1 parent 65811d6 commit 255a585
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mxq_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,6 @@ int mxq_set_job_status_running(struct mx_mysql *mysql, struct mxq_job *job)

if (job->job_status != MXQ_JOB_STATUS_LOADED) {
mx_log_warning("new status==runnning but old status(=%d) is != loaded ", job->job_status);
if (job->job_status != MXQ_JOB_STATUS_ASSIGNED) {
mx_log_err("new status==runnning but old status(=%d) is != (loaded || assigned). Aborting Status change.", job->job_status);
errno = EINVAL;
return -1;
}
}

char *query =
Expand All @@ -400,7 +395,7 @@ int mxq_set_job_status_running(struct mx_mysql *mysql, struct mxq_job *job)
" host_pid = ?,"
" host_slots = ?"
" WHERE job_id = ?"
" AND job_status IN (" status_str(MXQ_JOB_STATUS_ASSIGNED) ", " status_str(MXQ_JOB_STATUS_LOADED) ")"
" AND job_status = " status_str(MXQ_JOB_STATUS_LOADED)
" AND host_hostname = ?"
" AND server_id = ?"
" AND host_pid = 0";
Expand Down

0 comments on commit 255a585

Please sign in to comment.