1
0
Fork 0

Fix: Actually running the memory profile storage every 24hrs

This commit is contained in:
Michał Rudowicz 2024-04-08 19:27:35 +02:00
parent 8b33722b1c
commit cf790e88ff
1 changed files with 5 additions and 2 deletions

View File

@ -81,6 +81,11 @@ func main() {
go CloseSatelOnCtrlC(s, &cleanShutdown) 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( for e := range FilterByTypeOrIndex(
FilterByLastSeen(s.Events, &wg, &dataStore, log.New(os.Stderr, "FilterByLastSeen", log.Lmicroseconds)), FilterByLastSeen(s.Events, &wg, &dataStore, log.New(os.Stderr, "FilterByLastSeen", log.Lmicroseconds)),
&wg, config.AllowedTypes, config.AllowedIndexes) { &wg, config.AllowedTypes, config.AllowedIndexes) {
@ -88,8 +93,6 @@ func main() {
tgEvents <- GenericMessage{e.BasicEvents} tgEvents <- GenericMessage{e.BasicEvents}
} }
closeDebugTools := make(chan interface{})
WriteMemoryProfilePeriodically(&wg, log.New(os.Stderr, "DebugTools", log.Lmicroseconds), closeDebugTools)
logger.Print("Closing...") logger.Print("Closing...")
close(closeDebugTools) close(closeDebugTools)
close(tgEvents) close(tgEvents)