Skip to content

Commit

Permalink
Fix Undefined outFilesSrcStats
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJchen committed Sep 9, 2023
1 parent 3185a8e commit 04278aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions collector/tx_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,12 @@ func (p *TxProcessor) getOutputCSVFiles(timestamp int64) (fTx, fSrcStats *os.Fil
}

// if one file was opened, record it now
if !fTxOk || (p.recSourcelog && !fSrcStatsOk) {
if !fTxOk {
p.outFilesLock.Lock()
p.outFiles[bucketTS] = fTx
p.outFilesSrcStats[bucketTS] = fSrcStats
if p.recSourcelog && !fSrcStatsOk {
p.outFilesSrcStats[bucketTS] = fSrcStats
}
p.outFilesLock.Unlock()
isCreated = true
}
Expand Down

0 comments on commit 04278aa

Please sign in to comment.