1
This commit is contained in:
@@ -38,14 +38,14 @@ class BaseTask {
|
|||||||
if (existingLock && (now - existingLock) < 5 * 60 * 1000) {
|
if (existingLock && (now - existingLock) < 5 * 60 * 1000) {
|
||||||
const remainingTime = Math.ceil((5 * 60 * 1000 - (now - existingLock)) / 1000);
|
const remainingTime = Math.ceil((5 * 60 * 1000 - (now - existingLock)) / 1000);
|
||||||
return {
|
return {
|
||||||
success: false,
|
allowed: false,
|
||||||
reason: `任务 ${this.taskType} 正在添加中,请等待 ${remainingTime} 秒`
|
reason: `任务 ${this.taskType} 正在添加中,请等待 ${remainingTime} 秒`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取锁
|
// 获取锁
|
||||||
this.taskLocks.set(lockKey, now);
|
this.taskLocks.set(lockKey, now);
|
||||||
return { success: true };
|
return { allowed: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ module.exports = {
|
|||||||
acquire: 30000,
|
acquire: 30000,
|
||||||
idle: 10000
|
idle: 10000
|
||||||
},
|
},
|
||||||
logging: true
|
logging: false
|
||||||
},
|
},
|
||||||
|
|
||||||
// API 路径配置(必需)
|
// API 路径配置(必需)
|
||||||
|
|||||||
Reference in New Issue
Block a user