From dc5bba69e6325c8494fdaa803bc54a976a23ba25 Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Wed, 30 Aug 2023 11:13:48 +0200 Subject: [PATCH] chore(be): rename method --- services/tasks/TaskPool.go | 2 +- services/tasks/TaskRunner.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/tasks/TaskPool.go b/services/tasks/TaskPool.go index b5bad8205..4d949b666 100644 --- a/services/tasks/TaskPool.go +++ b/services/tasks/TaskPool.go @@ -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 diff --git a/services/tasks/TaskRunner.go b/services/tasks/TaskRunner.go index 98f5377e6..b93151e61 100644 --- a/services/tasks/TaskRunner.go +++ b/services/tasks/TaskRunner.go @@ -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() @@ -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", @@ -142,7 +142,7 @@ func (t *TaskRunner) run() { now := time.Now() t.Task.End = &now - t.updateStatus() + t.saveStatus() t.createTaskEvent() }()