perf: mongo index;fix: loading status and abort chat, system prompt empty

This commit is contained in:
archer
2023-06-06 11:12:13 +08:00
parent 707be3362c
commit 16018a7e0b
8 changed files with 35 additions and 21 deletions

View File

@@ -43,4 +43,11 @@ const BillSchema = new Schema({
}
});
try {
BillSchema.index({ time: -1 });
BillSchema.index({ userId: 1 });
} catch (error) {
error;
}
export const Bill: Model<BillType> = models['bill'] || model('bill', BillSchema);

View File

@@ -82,4 +82,11 @@ const ModelSchema = new Schema({
}
});
try {
ModelSchema.index({ updateTime: -1 });
ModelSchema.index({ 'share.collection': -1 });
} catch (error) {
error;
}
export const Model: MongoModel<ModelType> = models['model'] || model('model', ModelSchema);