Skip to content

Commit dddc3af

Browse files
committed
fix: resolve undefined h references and unused fmt import in phase_logs.go
1 parent 1f8a539 commit dddc3af

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

internal/utils/phase_logs.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package utils
22

33
import (
44
"encoding/json"
5-
"fmt"
65
"os"
76
"path/filepath"
87
"regexp"
@@ -110,12 +109,12 @@ func StartPhaseLogCapture(scanID, phaseKey string) func() {
110109
func 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.
158157
func 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
}

0 commit comments

Comments
 (0)