mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
fix 删除spider没有删除task
This commit is contained in:
@@ -191,7 +191,7 @@ func RemoveTask(id string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func RemoveTaskBySpiderId(id string) error {
|
||||
func RemoveTaskBySpiderId(id bson.ObjectId) error {
|
||||
tasks, err := GetTaskList(bson.M{"spider_id": id}, 0, constants.Infinite, "-create_ts")
|
||||
if err != nil {
|
||||
log.Error("get tasks error:" + err.Error())
|
||||
|
||||
@@ -230,7 +230,7 @@ func DeleteSpider(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 删除爬虫对应的task任务
|
||||
if err := model.RemoveTaskBySpiderId(spider.Id.Hex()); err != nil {
|
||||
if err := model.RemoveTaskBySpiderId(spider.Id); err != nil {
|
||||
HandleError(http.StatusInternalServerError, c, err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
:width="col.width">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column :label="$t('Action')" align="left" width="150px" fixed="right">
|
||||
<el-table-column :label="$t('Action')" align="left" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :content="$t('View')" placement="top">
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="onView(scope.row)"></el-button>
|
||||
|
||||
Reference in New Issue
Block a user