Check log file size more often to prevent huge log files

This commit is contained in:
Michal Horejsek 2020-07-31 13:24:25 +02:00
parent be07cb83c9
commit da381130a3
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
* GODT-409 Set flags have to replace all flags.
* GODT-531 Better way to add trusted certificate in macOS.
* Bumped golangci-lint to v1.29.0
* GODT-549 Check log file size more often to prevent huge log files.
### Fixed
* GODT-454 Fix send on closed channel when receiving unencrypted send confirmation from GUI.

View File

@ -152,7 +152,11 @@ func getLogFilename(logPrefix string) string {
func watchLogFileSize(logDir, logPrefix string) {
go func() {
for {
time.Sleep(60 * time.Second)
// Some rare bug can cause log file spamming a lot. Checking file
// size too often is not good, and at the same time postpone next
// check for too long is the same thing. 30 seconds seems as good
// compromise; average computer can generates ~500MB in 30 seconds.
time.Sleep(30 * time.Second)
checkLogFileSize(logDir, logPrefix)
}
}()