mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-04 22:29:10 +00:00
@@ -12,7 +12,7 @@ import {
|
||||
import { defaultDatasetDetail } from '@/constants/dataset';
|
||||
import type { DatasetUpdateBody } from '@fastgpt/global/core/dataset/api.d';
|
||||
import { DatasetStatusEnum } from '@fastgpt/global/core/dataset/constants';
|
||||
import { postCreateTrainingUsage } from '@/web/support/wallet/usage/api';
|
||||
import { postCreateTrainingBill } from '@/web/support/wallet/bill/api';
|
||||
import { checkTeamWebSyncLimit } from '@/web/support/user/team/api';
|
||||
|
||||
type State = {
|
||||
@@ -89,17 +89,19 @@ export const useDatasetStore = create<State>()(
|
||||
async startWebsiteSync() {
|
||||
await checkTeamWebSyncLimit();
|
||||
|
||||
const billId = await postCreateTrainingUsage({
|
||||
name: 'core.dataset.training.Website Sync',
|
||||
datasetId: get().datasetDetail._id
|
||||
});
|
||||
|
||||
return postWebsiteSync({ datasetId: get().datasetDetail._id, billId }).then(() => {
|
||||
const [_, billId] = await Promise.all([
|
||||
get().updateDataset({
|
||||
id: get().datasetDetail._id,
|
||||
status: DatasetStatusEnum.syncing
|
||||
});
|
||||
});
|
||||
}),
|
||||
postCreateTrainingBill({
|
||||
name: 'core.dataset.training.Website Sync',
|
||||
datasetId: get().datasetDetail._id
|
||||
})
|
||||
]);
|
||||
try {
|
||||
postWebsiteSync({ datasetId: get().datasetDetail._id, billId });
|
||||
} catch (error) {}
|
||||
}
|
||||
})),
|
||||
{
|
||||
|
@@ -68,6 +68,12 @@ export async function chunksUpload({
|
||||
});
|
||||
}
|
||||
|
||||
// add chunk index
|
||||
chunks = chunks.map((chunk) => ({
|
||||
...chunk,
|
||||
chunkIndex: chunk.chunkIndex
|
||||
}));
|
||||
|
||||
let successInsert = 0;
|
||||
let retryTimes = 10;
|
||||
for (let i = 0; i < chunks.length; i += rate) {
|
||||
|
Reference in New Issue
Block a user