fix(backend): fix memory leaks and resource issues in logs system
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:
MrFastwind
2026-07-24 16:25:09 +02:00
parent 6f3175ac9a
commit 8bf163a931
7 changed files with 242 additions and 63 deletions
+2 -2
View File
@@ -117,8 +117,8 @@ func (s *SteamCmdManager) run(label string, args []string) error {
s.cancel = cancel
go s.streamer.Stream("steamcmd", stdout, "")
go s.streamer.Stream("steamcmd", stderr, "")
go s.streamer.Stream(ctx, "steamcmd", stdout, "")
go s.streamer.Stream(ctx, "steamcmd", stderr, "")
go func() {
err := cmd.Wait()