File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package utils
22
33import (
44 "encoding/json"
5- "fmt"
65 "os"
76 "path/filepath"
87 "regexp"
@@ -110,12 +109,12 @@ func StartPhaseLogCapture(scanID, phaseKey string) func() {
110109func FlushPhaseLogBuffer (scanID , phaseKey string ) error {
111110 key := scanID + ":" + phaseKey
112111
113- h .mu .Lock ()
114- buf , ok := h .buffers [key ]
112+ globalPhaseLogHook .mu .Lock ()
113+ buf , ok := globalPhaseLogHook .buffers [key ]
115114 if ok {
116- delete (h .buffers , key )
115+ delete (globalPhaseLogHook .buffers , key )
117116 }
118- h .mu .Unlock ()
117+ globalPhaseLogHook .mu .Unlock ()
119118
120119 if ! ok || buf == nil {
121120 return nil
@@ -157,9 +156,9 @@ func FlushPhaseLogBuffer(scanID, phaseKey string) error {
157156// without flushing or deleting the buffer.
158157func ReadPhaseLogBuffer (scanID , phaseKey string ) []phaseLogEntry {
159158 key := scanID + ":" + phaseKey
160- h .mu .RLock ()
161- buf , ok := h .buffers [key ]
162- h .mu .RUnlock ()
159+ globalPhaseLogHook .mu .RLock ()
160+ buf , ok := globalPhaseLogHook .buffers [key ]
161+ globalPhaseLogHook .mu .RUnlock ()
163162 if ! ok || buf == nil {
164163 return nil
165164 }
You can’t perform that action at this time.
0 commit comments