Fixed Didn't call Close on UserStreamListener log messages when syncing (#940)

Signed-off-by: Suvid Sahay <sahay.suvid61@gmail.com>

Removing the extra imports
main
Suvid Sahay 2020-03-26 15:27:18 +05:30 committed by GitHub
parent 0b732d6f45
commit 314da91f1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -21,7 +21,6 @@ import (
"time" "time"
"github.com/matrix-org/dendrite/syncapi/types" "github.com/matrix-org/dendrite/syncapi/types"
"github.com/matrix-org/util"
) )
// UserStream represents a communication mechanism between the /sync request goroutine // UserStream represents a communication mechanism between the /sync request goroutine
@ -76,7 +75,6 @@ func (s *UserStream) GetListener(ctx context.Context) UserStreamListener {
// Lets be a bit paranoid here and check that Close() is being called // Lets be a bit paranoid here and check that Close() is being called
runtime.SetFinalizer(&listener, func(l *UserStreamListener) { runtime.SetFinalizer(&listener, func(l *UserStreamListener) {
if !l.hasClosed { if !l.hasClosed {
util.GetLogger(ctx).Warn("Didn't call Close on UserStreamListener")
l.Close() l.Close()
} }
}) })