Skip to content

Commit

Permalink
fixed pause not correctly moved to Quit on ResourceRemove
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmcatee committed Oct 2, 2019
1 parent 6ea4cf5 commit 82bf34c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions common/queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ func (q *Queue) QuitJob(jobuuid string) error {
return errors.New("empty job returned by quit RPC call")
}

if retJob.Status == common.STATUS_PAUSED {
// Job needs to be marked as Quit since it did not need to be stopped
retJob.Status = common.STATUS_QUIT
}

// Set a purge time
retJob.PurgeTime = time.Now().Add(time.Duration(q.jpurge*24) * time.Hour)
// Log purge time
Expand Down Expand Up @@ -1690,6 +1695,10 @@ func (q *Queue) RemoveResource(resUUID string) error {
log.Error(err)
}
} else {
if retJob.Status == common.STATUS_PAUSED {
// Job needs to be marked as Quit since it did not need to be stopped
retJob.Status = common.STATUS_QUIT
}
retJob.PurgeTime = time.Now().Add(time.Duration(q.jpurge*24) * time.Hour)

log.WithFields(log.Fields{
Expand Down
1 change: 1 addition & 0 deletions plugins/tools/hashcat5/tasker.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func (t *Tasker) Quit() common.Job {

log.WithFields(common.LogJob(t.job)).Debug("task quit successfully")
}

return t.job
}

Expand Down

0 comments on commit 82bf34c

Please sign in to comment.