feat: add Filesystem util and load env util (#7487)
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user