拍卖行:定时任务加锁

This commit is contained in:
luying
2022-05-05 19:26:11 +08:00
parent 4f42a8d3b5
commit c4793c7e8a
6 changed files with 106 additions and 85 deletions
@@ -18,10 +18,11 @@ import { checkSystemIsOpen } from './roleService';
* @param roleId
* @param roleName
*/
export async function getExpeditionStatus(roleId: string, roleName: string) {
export async function getExpeditionStatus(roleId: string, roleName: string, isEntry = false) {
// 重置次数
let role = await RoleModel.findByRoleId(roleId);
if(!checkSystemIsOpen(role, SYSTEM_OPEN_ID.EXPEDITION)) return false
if(!role.hasInit) return false;
if(isEntry && !checkSystemIsOpen(role, SYSTEM_OPEN_ID.EXPEDITION)) return false
// 获取远征关卡状态
let expeditionRecord = await ExpeditionRecordModel.getCurRecord(roleId);
if (!expeditionRecord) { // 首次新建一条记录