From c5efc28c82babd2a5a1f6b60fb6bf50a5c4277db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Rudowicz?= Date: Mon, 11 Mar 2024 23:41:42 +0100 Subject: [PATCH] Force GC when each event is at the end of its path --- sender_worker.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sender_worker.go b/sender_worker.go index 477db87..5e156b4 100644 --- a/sender_worker.go +++ b/sender_worker.go @@ -5,6 +5,7 @@ import ( "log" "net/http" "os" + "runtime" "sync" "git.sr.ht/~michalr/go-satel" @@ -25,6 +26,7 @@ type Sleeper interface { func Consume(events <-chan GenericMessage) { go func() { for range events { + runtime.GC() } }() }