server/gardening: drop an unnecessary field from 'ServeCtx'

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7108
GitOrigin-RevId: 50caff9e60d53261ce15870338bc3aa97c479190
This commit is contained in:
Anon Ray 2022-12-01 13:17:19 +05:30 committed by hasura-bot
parent 030f9f44f2
commit b398001c87

View File

@ -270,15 +270,14 @@ initGlobalCtx env metadataDbUrl defaultPgConnInfo = do
-- | Context required for the 'serve' CLI command. -- | Context required for the 'serve' CLI command.
data ServeCtx = ServeCtx data ServeCtx = ServeCtx
{ _scHttpManager :: !HTTP.Manager, { _scHttpManager :: HTTP.Manager,
_scInstanceId :: !InstanceId, _scInstanceId :: InstanceId,
_scLoggers :: !Loggers, _scLoggers :: Loggers,
_scEnabledLogTypes :: !(HashSet (EngineLogType Hasura)), _scEnabledLogTypes :: HashSet (EngineLogType Hasura),
_scMetadataDbPool :: !PG.PGPool, _scMetadataDbPool :: PG.PGPool,
_scShutdownLatch :: !ShutdownLatch, _scShutdownLatch :: ShutdownLatch,
_scSchemaCache :: !RebuildableSchemaCache, _scSchemaCacheRef :: SchemaCacheRef,
_scSchemaCacheRef :: !SchemaCacheRef, _scMetaVersionRef :: STM.TMVar MetadataResourceVersion
_scMetaVersionRef :: !(STM.TMVar MetadataResourceVersion)
} }
-- | Collection of the LoggerCtx, the regular Logger and the PGLogger -- | Collection of the LoggerCtx, the regular Logger and the PGLogger
@ -420,7 +419,6 @@ initialiseServeCtx env GlobalCtx {..} so@ServeOptions {..} serverMetrics = do
soEnabledLogTypes soEnabledLogTypes
metadataDbPool metadataDbPool
latch latch
rebuildableSchemaCache
schemaCacheRef schemaCacheRef
metaVersionRef metaVersionRef
@ -926,9 +924,10 @@ mkHGEServer setupHook env ServeOptions {..} ServeCtx {..} postPollHook serverMet
waitForProcessingAction l actionType processingEventsCountAction' shutdownAction (maxTimeout - (Seconds 5)) waitForProcessingAction l actionType processingEventsCountAction' shutdownAction (maxTimeout - (Seconds 5))
startEventTriggerPollerThread logger lockedEventsCtx cacheRef = do startEventTriggerPollerThread logger lockedEventsCtx cacheRef = do
schemaCache <- liftIO $ getSchemaCache cacheRef
let maxEventThreads = unrefine soEventsHttpPoolSize let maxEventThreads = unrefine soEventsHttpPoolSize
fetchInterval = milliseconds $ unrefine soEventsFetchInterval fetchInterval = milliseconds $ unrefine soEventsFetchInterval
allSources = HM.elems $ scSources $ lastBuiltSchemaCache _scSchemaCache allSources = HM.elems $ scSources schemaCache
unless (unrefine soEventsFetchBatchSize == 0 || fetchInterval == 0) $ do unless (unrefine soEventsFetchBatchSize == 0 || fetchInterval == 0) $ do
-- Don't start the events poller thread when fetchBatchSize or fetchInterval is 0 -- Don't start the events poller thread when fetchBatchSize or fetchInterval is 0