Skip to content

Commit

Permalink
Merge pull request #5436 from ShuBo6/dev
Browse files Browse the repository at this point in the history
fix: Missing close statements file.Close() & ticker.Stop()
  • Loading branch information
tarunKoyalwar authored Jul 24, 2024
2 parents 1fa0e2b + c5a3949 commit cb2e652
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pdcp/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (u *UploadWriter) autoCommit(ctx context.Context, r *io.PipeReader) {
// temporary buffer to store the results
buff := &bytes.Buffer{}
ticker := time.NewTicker(flushTimer)

defer ticker.Stop()
for {
select {
case <-ctx.Done():
Expand Down
1 change: 1 addition & 0 deletions pkg/scan/charts/echarts.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (s *ScanEventsCharts) GenerateHTML(filePath string) error {
if err != nil {
return err
}
defer output.Close()
return page.Render(output)
}

Expand Down
1 change: 1 addition & 0 deletions pkg/scan/events/stats_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (s *ScanStatsWorker) initEventsFile() error {
if err != nil {
return err
}
defer f.Close()
s.enc = json.NewEncoder(f)
return nil
}
Expand Down

0 comments on commit cb2e652

Please sign in to comment.