e1.0.1 Minor feature add, file restructure.

This commit is contained in:
2025-04-22 18:48:29 -04:00
parent b78da2b449
commit c809396455
11 changed files with 411 additions and 316 deletions

View File

@ -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")