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

@@ -39,11 +39,13 @@ export async function generateQA(): Promise<any> {
try {
const data = await MongoDatasetTraining.findOneAndUpdate(
{
lockTime: { $lte: addMinutes(new Date(), -6) },
mode: TrainingModeEnum.qa
mode: TrainingModeEnum.qa,
retryCount: { $gte: 0 },
lockTime: { $lte: addMinutes(new Date(), -6) }
},
{
lockTime: new Date()
lockTime: new Date(),
$inc: { retryCount: -1 }
}
)
.select({

View File

@@ -39,10 +39,12 @@ export async function generateVector(): Promise<any> {
const data = await MongoDatasetTraining.findOneAndUpdate(
{
mode: TrainingModeEnum.chunk,
lockTime: { $lte: addMinutes(new Date(), -1) }
retryCount: { $gte: 0 },
lockTime: { $lte: addMinutes(new Date(), -6) }
},
{
lockTime: new Date()
lockTime: new Date(),
$inc: { retryCount: -1 }
}
).select({
_id: 1,