fix(backend): fix memory leaks and resource issues in logs system
CI / build (push) Successful in 1m18s
CI / build (push) Successful in 1m18s
- Fix Subscribe overwriting channel without closing old one (goroutine leak) - Add context.Context to Stream() for cancellation support - Add WebSocket read pump to detect dead clients (StreamLogs, StreamSteamCMDLogs, StreamRPTLogs) - Use defer f.Close() pattern in StreamRPTLogs file handling - Fix findLatestRPT nil dereference on failed os.Stat - Optimize findLatestRPT to collect stat results before sorting - Apply gofmt formatting to modlists.go, settings.go
This commit is contained in:
@@ -148,8 +148,8 @@ func (pm *ProcessManager) Start() error {
|
||||
pm.mu.Unlock()
|
||||
pm.state.Store(int32(procRunning))
|
||||
|
||||
go pm.streamer.Stream("server", stdout, "")
|
||||
go pm.streamer.Stream("server", stderr, "")
|
||||
go pm.streamer.Stream(ctx, "server", stdout, "")
|
||||
go pm.streamer.Stream(ctx, "server", stderr, "")
|
||||
|
||||
go func() {
|
||||
cmd.Wait()
|
||||
|
||||
Reference in New Issue
Block a user