From 735c21bb2d2ce762732fe3508293d089c53b7c61 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Tue, 17 Dec 2024 19:04:37 +0800 Subject: [PATCH] f --- src/lib/load_schedule.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/load_schedule.ts b/src/lib/load_schedule.ts index c9410a0..b3fc656 100644 --- a/src/lib/load_schedule.ts +++ b/src/lib/load_schedule.ts @@ -2,6 +2,7 @@ import path from 'node:path'; import assert from 'node:assert'; import { stringify } from 'node:querystring'; import { isClass, isFunction, isGeneratorFunction } from 'is-type-of'; +import { importResolve } from '@eggjs/utils'; import type { EggApplicationCore, EggContext } from 'egg'; import type { EggScheduleConfig, EggScheduleTask, EggScheduleItem } from './types.js'; @@ -42,7 +43,7 @@ function getScheduleLoader(app: EggApplicationCore) { } // handle symlink case - const realFullpath = require.resolve(fullpath); + const realFullpath = importResolve(fullpath); target[realFullpath] = { schedule: scheduleConfig, scheduleQueryString: stringify(scheduleConfig as any),