Skip to content

Commit a212060

Browse files
committed
feat: add delete task job and list tasks job scheduler define and basic implement.
Signed-off-by: Asklv <boironic@gmail.com>
1 parent 16e73d6 commit a212060

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scheduler/job/job.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ func (j *job) syncPeers() (string, error) {
306306

307307
// listTasks is a job to list tasks.
308308
func (j *job) listTasks(ctx context.Context, data string) (string, error) {
309+
// TODO:
310+
// 1. query all peers with task id
311+
// 2. delete current task by task id and host id
309312
ctx, cancel := context.WithTimeout(ctx, listTasksTimeout)
310313
defer cancel()
311314

@@ -339,6 +342,8 @@ func (j *job) listTasks(ctx context.Context, data string) (string, error) {
339342

340343
// deleteTask is a job to delete task.
341344
func (j *job) deleteTask(ctx context.Context, data string) (string, error) {
345+
// TODO:
346+
// 1. query all peers with task id
342347
ctx, cancel := context.WithTimeout(ctx, deleteTaskTimeout)
343348
defer cancel()
344349

@@ -380,6 +385,9 @@ func (j *job) deleteTask(ctx context.Context, data string) (string, error) {
380385

381386
// TODO: change to scheduler delete task grpc function
382387
// and add batch delete
388+
j.resource.SeedPeer().Client().DeleteCacheTask(ctx, &dfdaemonv2.DeleteCacheTaskRequest{
389+
TaskId: req.TaskID,
390+
})
383391

384392
successTasks = append(successTasks, &internaljob.TaskInfo{
385393
Task: task,

0 commit comments

Comments
 (0)