fix: slow responses on schema cache reload

This commit is contained in:
steve-chavez
2024-03-15 11:53:29 -05:00
committed by Steve Chavez
parent 210cded560
commit 727ef465c1
4 changed files with 19 additions and 7 deletions
+3 -1
View File
@@ -319,10 +319,12 @@ loadSchemaCache appState observer = do
return SCOnRetry
Right sCache -> do
putSchemaCache appState $ Just sCache
observer $ SchemaCacheQueriedObs resultTime
(t, _) <- timeItT $ observer $ SchemaCacheSummaryObs sCache
observer $ SchemaCacheLoadedObs t
-- it's important to update AppState schema cache only once it has been fully evaluated before (this will be done by the observer above)
-- otherwise requests will wait for the schema cache to be loaded
putSchemaCache appState $ Just sCache
putSchemaCacheLoaded appState True
return SCLoaded