perf: app cron job (#3360)

This commit is contained in:
Archer
2024-12-10 14:05:34 +08:00
committed by GitHub
parent c98224dda3
commit b327e487a5
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);