Prevent a data race
This commit is contained in:
parent
0746797c73
commit
14a15e8b59
7
acid.go
7
acid.go
@ -22,6 +22,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -314,9 +315,9 @@ func handleTask(w http.ResponseWriter, r *http.Request) {
|
|||||||
rt.DeployLog.mu.Lock()
|
rt.DeployLog.mu.Lock()
|
||||||
defer rt.DeployLog.mu.Unlock()
|
defer rt.DeployLog.mu.Unlock()
|
||||||
|
|
||||||
task.RunLog = rt.RunLog.b
|
task.RunLog = slices.Clone(rt.RunLog.b)
|
||||||
task.TaskLog = rt.TaskLog.b
|
task.TaskLog = slices.Clone(rt.TaskLog.b)
|
||||||
task.DeployLog = rt.DeployLog.b
|
task.DeployLog = slices.Clone(rt.DeployLog.b)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if err := templateTask.Execute(w, &task); err != nil {
|
if err := templateTask.Execute(w, &task); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user