mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 01:12:56 +03:00
server: fix race condition in reloadAppContext
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9788 GitOrigin-RevId: c6b9441e4f4e12fea6ad4e5b336f3231fc4494d2
This commit is contained in:
parent
d61d523f77
commit
1d8d934157
@ -276,11 +276,12 @@ updateAppStateRef ::
|
|||||||
(MonadIO m, MonadBaseControl IO m) =>
|
(MonadIO m, MonadBaseControl IO m) =>
|
||||||
AppStateRef impl ->
|
AppStateRef impl ->
|
||||||
L.Logger L.Hasura ->
|
L.Logger L.Hasura ->
|
||||||
RebuildableAppContext impl ->
|
(RebuildableAppContext impl -> m (RebuildableAppContext impl, RebuildableSchemaCache)) ->
|
||||||
RebuildableSchemaCache ->
|
|
||||||
m ()
|
m ()
|
||||||
updateAppStateRef (AppStateRef lock cacheRef metadataVersionGauge) logger !newAppCtx !newSC =
|
updateAppStateRef appStateRef@(AppStateRef lock cacheRef metadataVersionGauge) logger action =
|
||||||
withMVarMasked lock $ const do
|
withMVarMasked lock $ const do
|
||||||
|
rebuildableAppContext <- liftIO $ readAppContextRef appStateRef
|
||||||
|
(!newAppCtx, !newSC) <- action rebuildableAppContext
|
||||||
liftIO do
|
liftIO do
|
||||||
-- update schemacache in IO reference
|
-- update schemacache in IO reference
|
||||||
modifyIORef' cacheRef $ \appState ->
|
modifyIORef' cacheRef $ \appState ->
|
||||||
|
Loading…
Reference in New Issue
Block a user