定时任务增加鉴权

This commit is contained in:
mtvpls
2026-01-01 22:38:42 +08:00
parent 97d748fa79
commit 70cb6f6589
4 changed files with 17 additions and 4 deletions

View File

@@ -58,8 +58,9 @@ const intervalId = setInterval(() => {
// 执行 cron 任务的函数
function executeCronJob() {
const cronPassword = process.env.CRON_PASSWORD || 'mtvpls';
const cronUrl = `http://${process.env.HOSTNAME || 'localhost'}:${process.env.PORT || 3000
}/api/cron`;
}/api/cron/${cronPassword}`;
console.log(`Executing cron job: ${cronUrl}`);