🐞 fix(邮件): 全服邮件慢查询问题
This commit is contained in:
@@ -13,6 +13,7 @@ class RoleStatus {
|
||||
status: number;
|
||||
}
|
||||
|
||||
@index({ serverId: 1 })
|
||||
@index({ sendTime: 1 })
|
||||
export default class ServerMail extends MailTemp {
|
||||
@prop({ required: true })
|
||||
@@ -95,9 +96,10 @@ export default class ServerMail extends MailTemp {
|
||||
* @param _id
|
||||
* @param roleId
|
||||
*/
|
||||
public static async delMailsByRoleId(roleId: string) {
|
||||
public static async delMailsByRoleId(roleId: string, serverId: number) {
|
||||
const ids: { _id: string }[] = await ServerMailModel.find(
|
||||
{
|
||||
serverId,
|
||||
isSp: false,
|
||||
sendTime:{ $lte: nowSeconds() },
|
||||
$or: [{
|
||||
|
||||
Reference in New Issue
Block a user