|
1 | 1 | {-# LANGUAGE UndecidableInstances #-} |
2 | 2 |
|
3 | | -module Hasura.App where |
| 3 | +module Hasura.App |
| 4 | + ( ExitCode (DatabaseMigrationError, DowngradeProcessError, MetadataCleanError, MetadataExportError, SchemaCacheInitError), |
| 5 | + ExitException (ExitException), |
| 6 | + GlobalCtx (GlobalCtx, _gcDefaultPostgresConnInfo, _gcHttpManager, _gcMetadataDbConnInfo), |
| 7 | + Loggers (..), |
| 8 | + PGMetadataStorageAppT (runPGMetadataStorageAppT), |
| 9 | + ServeCtx (ServeCtx, _scLoggers, _scMetadataDbPool, _scShutdownLatch), |
| 10 | + ShutdownLatch, |
| 11 | + accessDeniedErrMsg, |
| 12 | + flushLogger, |
| 13 | + getCatalogStateTx, |
| 14 | + initGlobalCtx, |
| 15 | + initialiseServeCtx, |
| 16 | + migrateCatalogSchema, |
| 17 | + mkLoggers, |
| 18 | + mkPGLogger, |
| 19 | + newShutdownLatch, |
| 20 | + notifySchemaCacheSyncTx, |
| 21 | + parseArgs, |
| 22 | + printErrExit, |
| 23 | + printErrJExit, |
| 24 | + printJSON, |
| 25 | + printYaml, |
| 26 | + readTlsAllowlist, |
| 27 | + resolvePostgresConnInfo, |
| 28 | + runHGEServer, |
| 29 | + setCatalogStateTx, |
| 30 | + shutdownGracefully, |
| 31 | + |
| 32 | + -- * Exported for testing |
| 33 | + mkHGEServer, |
| 34 | + mkPgSourceResolver, |
| 35 | + ) |
| 36 | +where |
4 | 37 |
|
5 | 38 | import Control.Concurrent.Async.Lifted.Safe qualified as LA |
6 | 39 | import Control.Concurrent.Extended qualified as C |
@@ -63,7 +96,6 @@ import Hasura.RQL.DDL.Schema.Cache.Common |
63 | 96 | import Hasura.RQL.DDL.Schema.Catalog |
64 | 97 | import Hasura.RQL.Types |
65 | 98 | import Hasura.RQL.Types.Eventing.Backend |
66 | | -import Hasura.RQL.Types.Run |
67 | 99 | import Hasura.SQL.AnyBackend qualified as AB |
68 | 100 | import Hasura.Server.API.Query (requiresAdmin) |
69 | 101 | import Hasura.Server.App |
@@ -936,15 +968,6 @@ mkHGEServer setupHook env ServeOptions {..} ServeCtx {..} initTime postPollHook |
936 | 968 | C.sleep (5) -- sleep for 5 seconds and then repeat |
937 | 969 | waitForProcessingAction l actionType processingEventsCountAction' shutdownAction (maxTimeout - (Seconds 5)) |
938 | 970 |
|
939 | | -runAsAdmin :: |
940 | | - HTTP.Manager -> |
941 | | - ServerConfigCtx -> |
942 | | - RunT m a -> |
943 | | - m (Either QErr a) |
944 | | -runAsAdmin httpManager serverConfigCtx m = do |
945 | | - let runCtx = RunCtx adminUserInfo httpManager serverConfigCtx |
946 | | - runExceptT $ peelRun runCtx m |
947 | | - |
948 | 971 | instance (Monad m) => Tracing.HasReporter (PGMetadataStorageAppT m) |
949 | 972 |
|
950 | 973 | instance (Monad m) => HasResourceLimits (PGMetadataStorageAppT m) where |
|
0 commit comments