perf: app cron job (#3360)

This commit is contained in:
Archer
2024-12-10 14:05:34 +08:00
committed by shilin66
parent e809ae2e2a
commit 5d4ace1595
9 changed files with 141 additions and 45 deletions

View File

@@ -121,6 +121,13 @@ const AppSchema = new Schema({
AppSchema.index({ teamId: 1, updateTime: -1 });
AppSchema.index({ teamId: 1, type: 1 });
AppSchema.index({ scheduledTriggerConfig: 1, scheduledTriggerNextTime: -1 });
AppSchema.index(
{ scheduledTriggerConfig: 1, scheduledTriggerNextTime: -1 },
{
partialFilterExpression: {
scheduledTriggerConfig: { $exists: true }
}
}
);
export const MongoApp = getMongoModel<AppType>(AppCollectionName, AppSchema);