diff options
| author | Přemysl Eric Janouch <p@janouch.name> | 2024-12-25 11:59:14 +0100 | 
|---|---|---|
| committer | Přemysl Eric Janouch <p@janouch.name> | 2024-12-25 23:14:54 +0100 | 
| commit | 14a15e8b599e5beed66645552cff2187f6e7eb2d (patch) | |
| tree | 166e733de9669e7cd2ebb490819d68fef5a8777d | |
| parent | 0746797c73999a41173aac8c409858f90531a08c (diff) | |
| download | acid-14a15e8b599e5beed66645552cff2187f6e7eb2d.tar.gz acid-14a15e8b599e5beed66645552cff2187f6e7eb2d.tar.xz acid-14a15e8b599e5beed66645552cff2187f6e7eb2d.zip  | |
Prevent a data race
| -rw-r--r-- | acid.go | 7 | 
1 files changed, 4 insertions, 3 deletions
@@ -22,6 +22,7 @@ import (  	"os/exec"  	"os/signal"  	"path/filepath" +	"slices"  	"sort"  	"strconv"  	"strings" @@ -314,9 +315,9 @@ func handleTask(w http.ResponseWriter, r *http.Request) {  		rt.DeployLog.mu.Lock()  		defer rt.DeployLog.mu.Unlock() -		task.RunLog = rt.RunLog.b -		task.TaskLog = rt.TaskLog.b -		task.DeployLog = rt.DeployLog.b +		task.RunLog = slices.Clone(rt.RunLog.b) +		task.TaskLog = slices.Clone(rt.TaskLog.b) +		task.DeployLog = slices.Clone(rt.DeployLog.b)  	}()  	if err := templateTask.Execute(w, &task); err != nil {  | 
