diff --git a/src/handlers/schedule/index.ts b/src/handlers/schedule/index.ts index bd0b187..bd81435 100644 --- a/src/handlers/schedule/index.ts +++ b/src/handlers/schedule/index.ts @@ -11,14 +11,12 @@ export const start = async (client: Client) => { const jobNames = await checkDirectory("schedules"); if (!jobNames) return logger.warn("⏰ No available jobs found"); - await Promise.all( - jobNames.map(async (jobName) => { - const job: IJob = await import(`../../schedules/${jobName}`); + jobNames.map(async (jobName) => { + const job: IJob = await import(`../../schedules/${jobName}`); - return schedule.scheduleJob(job.options.schedule, async () => { - logger.verbose(`⏰ Performed the job "${jobName}"`); - await job.execute(client); - }); - }) - ); + return schedule.scheduleJob(job.options.schedule, async () => { + logger.verbose(`⏰ Performed the job "${jobName}"`); + await job.execute(client); + }); + }); };