feat: add Filesystem util and load env util (#7487)

This commit is contained in:
Harminder Virk
2024-05-28 15:31:13 +05:30
committed by GitHub
parent 164bb988e7
commit ef6d748784
24 changed files with 389 additions and 194 deletions
@@ -1,7 +1,7 @@
import express from "express"
import getPort from "get-port"
import { resolve } from "path"
import { isObject, promiseAll } from "@medusajs/utils"
import { isObject, promiseAll, GracefulShutdownServer } from "@medusajs/utils"
import { MedusaContainer } from "@medusajs/types"
async function bootstrapApp({
@@ -52,7 +52,7 @@ export async function startApp({
let expressServer
const shutdown = async () => {
await promiseAll([expressServer.shutdown(), medusaShutdown()])
await promiseAll([expressServer?.shutdown(), medusaShutdown()])
if (typeof global !== "undefined" && global?.gc) {
global.gc()
@@ -77,10 +77,6 @@ export async function startApp({
})
// TODO: fix that once we find the appropriate place to put this util
const {
GracefulShutdownServer,
} = require("@medusajs/medusa/dist/utils/graceful-shutdown-server")
expressServer = GracefulShutdownServer.create(server)
})
}