server: fetch pending events across sources concurrently

https://github.com/hasura/graphql-engine-mono/pull/1562

GitOrigin-RevId: 763e60e8b175ba4b44aefbbf4ebe91455b8e3fff
This commit is contained in:
Karthikeyan Chinnakonda 2021-06-14 21:38:40 +05:30 committed by hasura-bot
parent 7d2f1c0536
commit 47de5e06cf

View File

@ -260,7 +260,8 @@ processEventQueue logger logenv httpMgr getSchemaCache EventEngineCtx{..} Locked
-}
pgSources <- scSources <$> liftIO getSchemaCache
liftIO . fmap concat $
for (M.toList pgSources) \(sourceName, sourceCache) -> concat . toList <$>
-- fetch pending events across all the sources asynchronously
LA.forConcurrently (M.toList pgSources) \(sourceName, sourceCache) -> concat . toList <$>
for (unsafeSourceTables @('Postgres 'Vanilla) sourceCache) \tables -> liftIO do
-- count the number of event triggers on tables in this source
let eventTriggerCount = sum (M.size . _tiEventTriggerInfoMap <$> tables)