Commit 9f8efc75 by 朱继来

调整删除接口参数

parent 38d5b952
Showing with 5 additions and 5 deletions
...@@ -66,7 +66,7 @@ ERR: ...@@ -66,7 +66,7 @@ ERR:
func handleJobDelete(resp http.ResponseWriter, req *http.Request) { func handleJobDelete(resp http.ResponseWriter, req *http.Request) {
var ( var (
err error // interface{} err error // interface{}
job_name string job_etcd_name string
node string node string
oldJob *common.Job oldJob *common.Job
bytes []byte bytes []byte
...@@ -78,11 +78,11 @@ func handleJobDelete(resp http.ResponseWriter, req *http.Request) { ...@@ -78,11 +78,11 @@ func handleJobDelete(resp http.ResponseWriter, req *http.Request) {
} }
// 删除的任务名、节点 // 删除的任务名、节点
job_name = req.PostForm.Get("job_name") job_etcd_name = req.PostForm.Get("job_etcd_name")
node = req.PostForm.Get("node") node = req.PostForm.Get("node")
// 去删除任务 // 去删除任务
if oldJob, err = G_jobMgr.DeleteJob(job_name, node); err != nil { if oldJob, err = G_jobMgr.DeleteJob(job_etcd_name, node); err != nil {
goto ERR goto ERR
} }
......
...@@ -168,7 +168,7 @@ func (jobMgr *JobMgr) SaveJob(req *http.Request) (oldJob *common.Job, err error) ...@@ -168,7 +168,7 @@ func (jobMgr *JobMgr) SaveJob(req *http.Request) (oldJob *common.Job, err error)
} }
// 删除任务 // 删除任务
func (jobMgr *JobMgr) DeleteJob(job_name string, node_ip string) (oldJob *common.Job, err error) { func (jobMgr *JobMgr) DeleteJob(job_etcd_name string, node_ip string) (oldJob *common.Job, err error) {
var ( var (
jobKey string jobKey string
delResp *clientv3.DeleteResponse delResp *clientv3.DeleteResponse
...@@ -176,7 +176,7 @@ func (jobMgr *JobMgr) DeleteJob(job_name string, node_ip string) (oldJob *common ...@@ -176,7 +176,7 @@ func (jobMgr *JobMgr) DeleteJob(job_name string, node_ip string) (oldJob *common
) )
// etcd中保存任务的key // etcd中保存任务的key
jobKey = common.JOB_SAVE_DIR + node_ip + "/" + job_name jobKey = common.JOB_SAVE_DIR + node_ip + "/" + job_etcd_name
// 从etcd中删除它 // 从etcd中删除它
if delResp, err = jobMgr.kv.Delete(context.TODO(), jobKey, clientv3.WithPrevKV()); err != nil { if delResp, err = jobMgr.kv.Delete(context.TODO(), jobKey, clientv3.WithPrevKV()); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment