diff --git a/modules/loghandler/loghandler.go b/modules/loghandler/loghandler.go index 4535c4c..eea7894 100644 --- a/modules/loghandler/loghandler.go +++ b/modules/loghandler/loghandler.go @@ -166,7 +166,7 @@ func GetAvailableLogTypes() []string { func StartBackgroundLogDeleter() { ticker := time.NewTicker(24 * time.Hour) - + for range ticker.C { CheckForDeletableLogs() } @@ -178,11 +178,11 @@ func CheckForDeletableLogs() { logFolder := config.Cfg.LogFolder err := filepath.Walk(logFolder, func(path string, info os.FileInfo, err error) error { - if err != nil { - fmt.Println(err) - return err - } - + if err != nil { + fmt.Println(err) + return err + } + if !info.IsDir() { // check if the file is older than the daysToKeepLogs // get the date from the file name @@ -212,15 +212,15 @@ func CheckForDeletableLogs() { AddLog(structs.LogBody{ Type: "system", - Logs: []string{"I "+ utils.GetTime() + "LogManager: Deleted log file " + path + " because it was older than " + strconv.Itoa(daysToKeepLogs) + " days."}, + Logs: []string{"I " + utils.GetTime() + "LogManager: Deleted log file " + path + " because it was older than " + strconv.Itoa(daysToKeepLogs) + " days."}, }) } } - return nil - }) + return nil + }) - if err != nil { - fmt.Println(err) - } -} \ No newline at end of file + if err != nil { + fmt.Println(err) + } +} diff --git a/modules/structs/sseclient.go b/modules/structs/sseclient.go index 68389d3..026b543 100644 --- a/modules/structs/sseclient.go +++ b/modules/structs/sseclient.go @@ -1,6 +1,8 @@ package structs -import "github.com/google/uuid" +import ( + "github.com/google/uuid" +) type SSEClient struct { MessageChannel chan SSEClientChannelMessage