feat: implement automated job cleanup, update notification presets, and upgrade Baileys library
This commit is contained in:
@@ -102,4 +102,12 @@ export class NotificationJobModel {
|
||||
this.schema
|
||||
);
|
||||
}
|
||||
|
||||
async deleteBeforeScheduledAt(cutoff: Date): Promise<number> {
|
||||
const result = await this.notificationJobList.deleteMany({
|
||||
scheduledAt: { $lt: cutoff },
|
||||
}).exec();
|
||||
|
||||
return result.deletedCount || 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user