Skip to content

Commit

Permalink
chore(be): rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Aug 30, 2023
1 parent 9f9606e commit dc5bba6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion services/tasks/TaskPool.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (p *TaskPool) Run() {
msg := "Task " + strconv.Itoa(task.Task.ID) + " added to queue"
task.Log(msg)
log.Info(msg)
task.updateStatus()
task.saveStatus()
})

case <-ticker.C: // timer 5 seconds
Expand Down
6 changes: 3 additions & 3 deletions services/tasks/TaskRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (t *TaskRunner) setStatus(status db.TaskStatus) {

t.Task.Status = status

t.updateStatus()
t.saveStatus()

if status == db.TaskFailStatus {
t.sendMailAlert()
Expand All @@ -81,7 +81,7 @@ func (t *TaskRunner) setStatus(status db.TaskStatus) {
}
}

func (t *TaskRunner) updateStatus() {
func (t *TaskRunner) saveStatus() {
for _, user := range t.users {
b, err := json.Marshal(&map[string]interface{}{
"type": "update",
Expand Down Expand Up @@ -142,7 +142,7 @@ func (t *TaskRunner) run() {

now := time.Now()
t.Task.End = &now
t.updateStatus()
t.saveStatus()
t.createTaskEvent()
}()

Expand Down

0 comments on commit dc5bba6

Please sign in to comment.