Skip to content

Commit

Permalink
#291 作业启用/禁用写入到数据库
Browse files Browse the repository at this point in the history
  • Loading branch information
kfchu committed Nov 17, 2017
1 parent c6636e2 commit 284d983
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ public void call(CuratorRepository.CuratorFrameworkOp curatorFrameworkOp)
long ctime = curatorFrameworkOp.getCtime(enabledNodePath);
long mtime = curatorFrameworkOp.getMtime(enabledNodePath);
checkUpdateStatusToEnableAllowed(ctime, mtime);

curatorFrameworkOp.update(enabledNodePath, "true");
jobOperationService.setJobEnabledState(jobName, true);
}
}
});
Expand All @@ -410,8 +409,7 @@ public void call(CuratorRepository.CuratorFrameworkOp curatorFrameworkOp)
if (Boolean.valueOf(enabled)) {
long mtime = curatorFrameworkOp.getMtime(enabledNodePath);
checkUpdateStatusToDisableAllowed(mtime);

curatorFrameworkOp.update(enabledNodePath, "false");
jobOperationService.setJobEnabledState(jobName, false);
} else {
throw new SaturnJobConsoleHttpException(HttpStatus.CREATED.value(),
"The job is already disable");
Expand Down

0 comments on commit 284d983

Please sign in to comment.