From 1a6f40692ae4354e29e2aa985fb62f7266d383ae Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 22 Jul 2021 20:52:43 -0500 Subject: [PATCH] Handle incoming stanzas one-by-one We are sharing the sqlite connection everywhere and may be seeing race conditions. At least until we can rule that out, let's be safe and only process stazas one-by-one instead of in infinite threads. --- Router.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Router.hs b/Router.hs index c2dfd21..0c8ff45 100644 --- a/Router.hs +++ b/Router.hs @@ -16,7 +16,7 @@ runRoutedComponent server secret = ExceptT . XMPP.runComponent server secret . (runRouted =<<) runRouted :: Routes -> XMPP.XMPP () -runRouted routes = forever $ XMPP.getStanza >>= (void . forkXMPP . handle) +runRouted routes = forever $ XMPP.getStanza >>= (void . handle) where handle (XMPP.ReceivedPresence presence@XMPP.Presence { XMPP.presenceType = XMPP.PresenceProbe -- 2.45.2