|
|
@@ -125,12 +125,8 @@ schema.statics.findMainOps = async function(
|
|
|
);
|
|
|
};
|
|
|
|
|
|
-schema.statics.cleanup = async function(excludeList: PageActionType[]): Promise<void> {
|
|
|
- await this.deleteMany({ actionType: { $nin: excludeList } });
|
|
|
-};
|
|
|
-
|
|
|
-schema.statics.markAsFailure = async function(): Promise<void> {
|
|
|
- await this.updateMany({}, { isFailure: true });
|
|
|
+schema.statics.cleanup = async function(excludeActionTypeList: PageActionType[], excludeStage: PageActionStage): Promise<void> {
|
|
|
+ await this.deleteMany({ actionType: { $nin: excludeActionTypeList }, actionStage: { $ne: excludeStage } });
|
|
|
};
|
|
|
|
|
|
export default getOrCreateModel<PageOperationDocument, PageOperationModel>('PageOperation', schema);
|