From cf790e88ff3d2498b7e8faa994227d89534d31a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Mon, 8 Apr 2024 19:27:35 +0200 Subject: [PATCH] Fix: Actually running the memory profile storage every 24hrs --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 90dff75..89abb86 100644 --- a/main.go +++ b/main.go @@ -81,6 +81,11 @@ func main() { go CloseSatelOnCtrlC(s, &cleanShutdown) + closeDebugTools := make(chan interface{}) + if config.WriteMemoryProfile { + WriteMemoryProfilePeriodically(&wg, log.New(os.Stderr, "DebugTools", log.Lmicroseconds), closeDebugTools) + } + for e := range FilterByTypeOrIndex( FilterByLastSeen(s.Events, &wg, &dataStore, log.New(os.Stderr, "FilterByLastSeen", log.Lmicroseconds)), &wg, config.AllowedTypes, config.AllowedIndexes) { @@ -88,8 +93,6 @@ func main() { tgEvents <- GenericMessage{e.BasicEvents} } - closeDebugTools := make(chan interface{}) - WriteMemoryProfilePeriodically(&wg, log.New(os.Stderr, "DebugTools", log.Lmicroseconds), closeDebugTools) logger.Print("Closing...") close(closeDebugTools) close(tgEvents)