feat: add training retry time (#3187)

* feat: add training retry time

* remoce log
This commit is contained in:
Archer
2024-11-18 20:57:03 +08:00
committed by GitHub
parent fdb3720b41
commit a9db5b57c5
4 changed files with 49 additions and 7 deletions

View File

@@ -51,6 +51,11 @@ const TrainingDataSchema = new Schema({
type: Date,
default: () => new Date('2000/1/1')
},
retryCount: {
type: Number,
default: 5
},
model: {
// ai model
type: String,
@@ -97,7 +102,7 @@ try {
// lock training data(teamId); delete training data
TrainingDataSchema.index({ teamId: 1, datasetId: 1 });
// get training data and sort
TrainingDataSchema.index({ mode: 1, lockTime: 1, weight: -1 });
TrainingDataSchema.index({ mode: 1, retryCount: 1, lockTime: 1, weight: -1 });
TrainingDataSchema.index({ expireAt: 1 }, { expireAfterSeconds: 7 * 24 * 60 * 60 }); // 7 days
} catch (error) {
console.log(error);