forked from Silverfish/proton-bridge
Check log file size more often to prevent huge log files
This commit is contained in:
@ -8,6 +8,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* GODT-409 Set flags have to replace all flags.
|
* GODT-409 Set flags have to replace all flags.
|
||||||
* GODT-531 Better way to add trusted certificate in macOS.
|
* GODT-531 Better way to add trusted certificate in macOS.
|
||||||
* Bumped golangci-lint to v1.29.0
|
* Bumped golangci-lint to v1.29.0
|
||||||
|
* GODT-549 Check log file size more often to prevent huge log files.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* GODT-454 Fix send on closed channel when receiving unencrypted send confirmation from GUI.
|
* GODT-454 Fix send on closed channel when receiving unencrypted send confirmation from GUI.
|
||||||
|
|||||||
@ -152,7 +152,11 @@ func getLogFilename(logPrefix string) string {
|
|||||||
func watchLogFileSize(logDir, logPrefix string) {
|
func watchLogFileSize(logDir, logPrefix string) {
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
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)
|
checkLogFileSize(logDir, logPrefix)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user