From 905f9ff9764ac0fa294b9e5caf3b5efc13c20569 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 18 Oct 2024 16:55:30 +0300 Subject: [PATCH] userinfo: skip resync if client isn't logged in --- pkg/connector/userinfo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/connector/userinfo.go b/pkg/connector/userinfo.go index f4c735f9..e18880d9 100644 --- a/pkg/connector/userinfo.go +++ b/pkg/connector/userinfo.go @@ -92,6 +92,10 @@ func (wa *WhatsAppClient) rotateResyncQueue() map[types.JID]resyncQueueItem { func (wa *WhatsAppClient) doGhostResync(ctx context.Context, queue map[types.JID]resyncQueueItem) { log := zerolog.Ctx(ctx) + if !wa.IsLoggedIn() { + log.Warn().Msg("Not logged in, skipping background resyncs") + return + } log.Debug().Msg("Starting background resyncs") defer log.Debug().Msg("Background resyncs finished") var ghostJIDs []types.JID