Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Commit

Permalink
Bug 1402152 - use creds returned from claimWork to reclaim and resolv…
Browse files Browse the repository at this point in the history
…e tasks
  • Loading branch information
petemoore committed Sep 25, 2017
1 parent c91adbc commit 18ee7b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions taskstatus.go
Expand Up @@ -53,7 +53,7 @@ func (tsm *TaskStatusManager) ReportException(reason TaskUpdateReason) error {
errored,
func(task *TaskRun) error {
ter := queue.TaskExceptionRequest{Reason: string(reason)}
tsr, err := Queue.ReportException(task.TaskID, strconv.FormatInt(int64(task.RunID), 10), &ter)
tsr, err := task.Queue.ReportException(task.TaskID, strconv.FormatInt(int64(task.RunID), 10), &ter)
if err != nil {
log.Printf("Not able to report exception for task %v:", task.TaskID)
log.Printf("%v", err)
Expand All @@ -73,7 +73,7 @@ func (tsm *TaskStatusManager) ReportFailed() error {
return tsm.updateStatus(
failed,
func(task *TaskRun) error {
tsr, err := Queue.ReportFailed(task.TaskID, strconv.FormatInt(int64(task.RunID), 10))
tsr, err := task.Queue.ReportFailed(task.TaskID, strconv.FormatInt(int64(task.RunID), 10))
if err != nil {
log.Printf("Not able to report failed completion for task %v:", task.TaskID)
log.Printf("%v", err)
Expand All @@ -94,7 +94,7 @@ func (tsm *TaskStatusManager) ReportCompleted() error {
succeeded,
func(task *TaskRun) error {
log.Print("Command finished successfully!")
tsr, err := Queue.ReportCompleted(task.TaskID, strconv.FormatInt(int64(task.RunID), 10))
tsr, err := task.Queue.ReportCompleted(task.TaskID, strconv.FormatInt(int64(task.RunID), 10))
if err != nil {
log.Printf("Not able to report successful completion for task %v:", task.TaskID)
log.Printf("%v", err)
Expand All @@ -114,7 +114,7 @@ func (tsm *TaskStatusManager) Reclaim() error {
reclaimed,
func(task *TaskRun) error {
log.Printf("Reclaiming task %v...", task.TaskID)
tcrsp, err := Queue.ReclaimTask(task.TaskID, fmt.Sprintf("%d", task.RunID))
tcrsp, err := task.Queue.ReclaimTask(task.TaskID, fmt.Sprintf("%d", task.RunID))

// check if an error occurred...
if err != nil {
Expand Down

0 comments on commit 18ee7b4

Please sign in to comment.