db8de114d3
* feat(server): log subscription started messages with info * feat(server): create projects in a default region * feat(server): allow project default region config * feat(server): load project region from multi region config
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { moduleLogger } from '@/logging/logging'
|
|
import {
|
|
getValidDefaultProjectRegionKey,
|
|
initializeRegisteredRegionClients as initDb
|
|
} from '@/modules/multiregion/utils/dbSelector'
|
|
import { isMultiRegionEnabled } from '@/modules/multiregion/helpers'
|
|
import { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
|
|
import {
|
|
initializeRegisteredRegionClients as initBlobs,
|
|
isMultiRegionBlobStorageEnabled
|
|
} from '@/modules/multiregion/utils/blobStorageSelector'
|
|
|
|
const multiRegion: SpeckleModule = {
|
|
async init() {
|
|
const isEnabled = isMultiRegionEnabled()
|
|
if (!isEnabled) {
|
|
return
|
|
}
|
|
|
|
moduleLogger.info('🌍 Init multiRegion module')
|
|
|
|
// Init registered region clients
|
|
await initDb()
|
|
// validate default project region key
|
|
await getValidDefaultProjectRegionKey()
|
|
|
|
const isBlobStorageEnabled = isMultiRegionBlobStorageEnabled()
|
|
if (isBlobStorageEnabled) {
|
|
moduleLogger.info('🌍 Init multiRegion blob storage')
|
|
await initBlobs()
|
|
}
|
|
}
|
|
}
|
|
|
|
export default multiRegion
|