report incoming relay posts to statistics

This commit is contained in:
Trolli Schmittlauch 2020-09-09 19:25:48 +02:00
parent 85d10f6773
commit 620e998876

View file

@ -185,8 +185,10 @@ relayInbox serv tag posts = do
-- if noone subscribed to the tag, nothing needs to be done
(pure ())
-- otherwise enqueue posts into broadcast queue of the tag
(\queue ->
(\queue -> do
liftIO $ forM_ postIDs (atomically . writeTChan queue)
-- report the received post for statistic purposes
liftIO . atomically . writeTQueue (statsQueue serv) $ StatsEvent RelayReceiveEvent (length postIDs) (hashtagToId tag)
)
broadcastChan
pure NoContent