Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
30ca3e3d
authored
Jun 12, 2025
by
Archer
Committed by
GitHub
Jun 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dataset image will expired (#5021)
parent
f32e0ff8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
25 deletions
+22
-25
packages/service/core/dataset/collection/controller.ts
+0
-19
projects/app/src/pages/api/core/dataset/collection/create/apiCollection.ts
+0
-1
projects/app/src/pages/api/core/dataset/collection/create/link.ts
+1
-3
projects/app/src/pages/api/core/dataset/collection/create/localFile.ts
+0
-1
projects/app/src/pages/api/core/dataset/collection/create/reTrainingCollection.ts
+0
-1
projects/app/src/service/core/dataset/queues/datasetParse.ts
+21
-0
No files found.
packages/service/core/dataset/collection/controller.ts
View file @
30ca3e3d
...
...
@@ -41,7 +41,6 @@ import { clearCollectionImages, removeDatasetImageExpiredTime } from '../image/u
export
const
createCollectionAndInsertData
=
async
({
dataset
,
rawText
,
relatedId
,
imageIds
,
createCollectionParams
,
backupParse
=
false
,
...
...
@@ -50,7 +49,6 @@ export const createCollectionAndInsertData = async ({
}:
{
dataset
:
DatasetSchemaType
;
rawText
?:
string
;
relatedId
?:
string
;
imageIds
?:
string
[];
createCollectionParams
:
CreateOneCollectionParams
;
...
...
@@ -258,23 +256,6 @@ export const createCollectionAndInsertData = async ({
collectionId
,
session
});
if
(
relatedId
)
{
await
MongoImage
.
updateMany
(
{
teamId
,
'metadata.relatedId'
:
relatedId
},
{
// Remove expiredTime to avoid ttl expiration
$unset
:
{
expiredTime
:
1
}
},
{
session
}
);
}
return
{
collectionId
:
String
(
collectionId
),
...
...
projects/app/src/pages/api/core/dataset/collection/create/apiCollection.ts
View file @
30ca3e3d
...
...
@@ -46,7 +46,6 @@ async function handler(
const
{
collectionId
,
insertResults
}
=
await
createCollectionAndInsertData
({
dataset
,
relatedId
:
apiFileId
,
createCollectionParams
:
{
...
body
,
teamId
,
...
...
projects/app/src/pages/api/core/dataset/collection/create/link.ts
View file @
30ca3e3d
...
...
@@ -31,9 +31,7 @@ async function handler(req: NextApiRequest): CreateCollectionResponse {
webPageSelector
:
body
?.
metadata
?.
webPageSelector
},
rawLink
:
link
},
relatedId
:
link
}
});
return
{
...
...
projects/app/src/pages/api/core/dataset/collection/create/localFile.ts
View file @
30ca3e3d
...
...
@@ -62,7 +62,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>): CreateCo
// 3. Create collection
const
{
collectionId
,
insertResults
}
=
await
createCollectionAndInsertData
({
dataset
,
relatedId
:
relatedImgId
,
createCollectionParams
:
{
...
collectionData
,
name
:
collectionName
,
...
...
projects/app/src/pages/api/core/dataset/collection/create/reTrainingCollection.ts
View file @
30ca3e3d
...
...
@@ -44,7 +44,6 @@ async function handler(
const
{
collectionId
}
=
await
createCollectionAndInsertData
({
dataset
:
collection
.
dataset
,
relatedId
:
collection
.
metadata
?.
relatedImgId
,
createCollectionParams
:
{
...
collection
,
...
data
,
...
...
projects/app/src/service/core/dataset/queues/datasetParse.ts
View file @
30ca3e3d
...
...
@@ -30,6 +30,7 @@ import { MongoDatasetCollection } from '@fastgpt/service/core/dataset/collection
import
{
hashStr
}
from
'@fastgpt/global/common/string/tools'
;
import
{
POST
}
from
'@fastgpt/service/common/api/plusRequest'
;
import
{
pushLLMTrainingUsage
}
from
'@fastgpt/service/support/wallet/usage/controller'
;
import
{
MongoImage
}
from
'@fastgpt/service/common/file/image/schema'
;
const
requestLLMPargraph
=
async
({
rawText
,
...
...
@@ -321,6 +322,26 @@ export const datasetParseQueue = async (): Promise<any> => {
session
}
);
// 8. Remove image ttl
const
relatedImgId
=
collection
.
metadata
?.
relatedImgId
;
if
(
relatedImgId
)
{
await
MongoImage
.
updateMany
(
{
teamId
:
collection
.
teamId
,
'metadata.relatedId'
:
relatedImgId
},
{
// Remove expiredTime to avoid ttl expiration
$unset
:
{
expiredTime
:
1
}
},
{
session
}
);
}
});
addLog
.
debug
(
`[Parse Queue] Finish`
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment