Skip to content
Snippets Groups Projects
Commit 3defd9a6 authored by 조대희's avatar 조대희
Browse files

feat: 유동 스케줄 자동 정리 (#5)

parent 0639c08d
No related branches found
No related tags found
2 merge requests!31Develop,!6[#5] Schedule 서비스 로직 개발
......@@ -135,5 +135,25 @@ class schedulService {
}
}
/**
* 만료된 유동 스케줄 정리 -> utils에 cron job 추가해서 실행하도록 설정
*/
async cleanExpiredSchedules() {
try {
await Schedule.destroy({
where: {
is_fixed: false,
expiry_date: {
[Op.lte]: new Date()
}
}
});
} catch (error) {
throw new Error(`Failed to clean expired schedules: ${error.message}`);
}
}
}
module.exports = new scheduleService();
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment