diff --git a/Changelog.md b/Changelog.md index 2c3cc54d..11bdb634 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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. diff --git a/pkg/config/logs.go b/pkg/config/logs.go index 9f0d299b..e55db04e 100644 --- a/pkg/config/logs.go +++ b/pkg/config/logs.go @@ -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) } }()