fix(medusa): Instrumentation resolution (#9368)
This commit is contained in:
@@ -4,6 +4,7 @@ import { track } from "medusa-telemetry"
|
|||||||
import { scheduleJob } from "node-schedule"
|
import { scheduleJob } from "node-schedule"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
dynamicImport,
|
||||||
gqlSchemaToTypes,
|
gqlSchemaToTypes,
|
||||||
GracefulShutdownServer,
|
GracefulShutdownServer,
|
||||||
} from "@medusajs/framework/utils"
|
} from "@medusajs/framework/utils"
|
||||||
@@ -24,7 +25,7 @@ const CRON_SCHEDULE = EVERY_SIXTH_HOUR
|
|||||||
*/
|
*/
|
||||||
async function registerInstrumentation(directory: string) {
|
async function registerInstrumentation(directory: string) {
|
||||||
try {
|
try {
|
||||||
const instrumentation = await import(
|
const instrumentation = await dynamicImport(
|
||||||
path.join(directory, "instrumentation.js")
|
path.join(directory, "instrumentation.js")
|
||||||
)
|
)
|
||||||
if (typeof instrumentation.register === "function") {
|
if (typeof instrumentation.register === "function") {
|
||||||
|
|||||||
Reference in New Issue
Block a user