e1.0.1 Minor feature add, file restructure.
This commit is contained in:
11
processor.go
11
processor.go
@ -1,4 +1,4 @@
|
||||
// processor.go
|
||||
// --- File: processor.go ---
|
||||
package log
|
||||
|
||||
import (
|
||||
@ -146,7 +146,10 @@ func (l *Logger) processLogs(ch <-chan logRecord) {
|
||||
}
|
||||
|
||||
case <-flushTicker.C:
|
||||
l.performSync()
|
||||
enableSync, _ := l.config.Bool("log.enable_periodic_sync")
|
||||
if enableSync {
|
||||
l.performSync()
|
||||
}
|
||||
|
||||
case <-diskCheckTicker.C:
|
||||
// Periodic disk check
|
||||
@ -188,6 +191,10 @@ func (l *Logger) processLogs(ch <-chan logRecord) {
|
||||
lastCheckTime = time.Now()
|
||||
}
|
||||
|
||||
case confirmChan := <-l.state.flushRequestChan:
|
||||
l.performSync()
|
||||
close(confirmChan) // Signal completion back to the Flush caller
|
||||
|
||||
case <-retentionChan:
|
||||
// Check file retention
|
||||
retentionPeriodHrs, _ := l.config.Float64("log.retention_period_hrs")
|
||||
|
||||
Reference in New Issue
Block a user