Skip to content

Commit

Permalink
Retry now duplicates the task
Browse files Browse the repository at this point in the history
  • Loading branch information
xeome committed Oct 18, 2023
1 parent 4bbd98c commit 737dbf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions internal/polling.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@ func GetPollingData(index int) PageData {
Tasks: tasks,
}

// addOneTask()

return data
}
10 changes: 6 additions & 4 deletions internal/retry.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package internal

func RetryTask(task *Task) {
if err := updateTaskStatus(task, "Pending"); err != nil {
log.Errorf("Failed to add task: %s", err)
}
newTask := *task
newTask.Status = "Pending"
newTask.ID = queue.Len() + 1
queue.PushFront(&newTask)
AddTaskToDB(task)
go func() {
taskChan <- *task
taskChan <- newTask
}()
}

0 comments on commit 737dbf7

Please sign in to comment.