去掉发邮件时的上限判断机制
This commit is contained in:
parent
ea179c2a3c
commit
3f275e4af4
@ -186,27 +186,29 @@ export class EmailFun {
|
|||||||
sendEmail.lngContent = email.lngContent
|
sendEmail.lngContent = email.lngContent
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isCross) {
|
//太亏了!换其他清理机制,getAllEmail是性能消耗大户
|
||||||
let emailList = await this.getAllEmail(uid);
|
//todo.. 换其他清理机制
|
||||||
if (emailList.length >= 50) {
|
// if (!isCross) {
|
||||||
emailList.sort((a, b) => {
|
// let emailList = await this.getAllEmail(uid);
|
||||||
let noPrizeA = a.prizeData == undefined ? 0 : 1;
|
// if (emailList.length >= 50) {
|
||||||
let noPrizeB = b.prizeData == undefined ? 0 : 1;
|
// emailList.sort((a, b) => {
|
||||||
let getA = a.prizeData?.isGet == true ? 0 : 1;
|
// let noPrizeA = a.prizeData == undefined ? 0 : 1;
|
||||||
let getB = b.prizeData?.isGet == true ? 0 : 1;
|
// let noPrizeB = b.prizeData == undefined ? 0 : 1;
|
||||||
|
// let getA = a.prizeData?.isGet == true ? 0 : 1;
|
||||||
|
// let getB = b.prizeData?.isGet == true ? 0 : 1;
|
||||||
|
|
||||||
if (noPrizeA != noPrizeB) {
|
// if (noPrizeA != noPrizeB) {
|
||||||
return noPrizeA - noPrizeB;
|
// return noPrizeA - noPrizeB;
|
||||||
} else if (getA != getB) {
|
// } else if (getA != getB) {
|
||||||
return getA - getB;
|
// return getA - getB;
|
||||||
}
|
// }
|
||||||
return a.createTime - b.createTime;
|
// return a.createTime - b.createTime;
|
||||||
});
|
// });
|
||||||
|
|
||||||
this.removeEmail(uid, emailList[0]._id);
|
// this.removeEmail(uid, emailList[0]._id);
|
||||||
G.server.sendMsgByUid(uid, 'msg_s2c/EmailDel', emailList[0]._id);
|
// G.server.sendMsgByUid(uid, 'msg_s2c/EmailDel', emailList[0]._id);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
let _id = (await G.mongodb.collection('email').insertOne({
|
let _id = (await G.mongodb.collection('email').insertOne({
|
||||||
ttl: new Date(), ...G.mongodb.conversionIdObj(sendEmail)
|
ttl: new Date(), ...G.mongodb.conversionIdObj(sendEmail)
|
||||||
|
Loading…
Reference in New Issue
Block a user