|
|
|
@ -35,6 +35,11 @@ class TaskMoniter {
@@ -35,6 +35,11 @@ class TaskMoniter {
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getTaskFilePath(task_id) { |
|
|
|
|
const dirPath = path.resolve(this.task_dir); |
|
|
|
|
return `${dirPath}/${task_id}.task`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getStatus() { |
|
|
|
|
return this.taskStatus; |
|
|
|
|
} |
|
|
|
@ -71,6 +76,8 @@ class TaskMoniter {
@@ -71,6 +76,8 @@ class TaskMoniter {
|
|
|
|
|
this.tasks[task_id].status = this.statusCode.done; |
|
|
|
|
this.taskStatus[this.statusCode.done] ++; |
|
|
|
|
|
|
|
|
|
const filepath = this.getTaskFilePath(task_id); |
|
|
|
|
common.removeFile(filepath); //async delete
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|