mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00

* perf: check balance * md * lock way * i18n * docs * doc * i18n * update doc * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync * feat: one link sync
22 lines
520 B
TypeScript
22 lines
520 B
TypeScript
import { delay } from '@fastgpt/global/common/system/utils';
|
|
import { MongoDatasetTraining } from './schema';
|
|
|
|
export const lockTrainingDataByTeamId = async (teamId: string, retry = 3): Promise<any> => {
|
|
try {
|
|
await MongoDatasetTraining.updateMany(
|
|
{
|
|
teamId
|
|
},
|
|
{
|
|
lockTime: new Date('2999/5/5')
|
|
}
|
|
);
|
|
} catch (error) {
|
|
if (retry > 0) {
|
|
await delay(1000);
|
|
return lockTrainingDataByTeamId(teamId, retry - 1);
|
|
}
|
|
return Promise.reject(error);
|
|
}
|
|
};
|