Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
a1b48f49
Commit
a1b48f49
authored
Mar 13, 2024
by
crazywoola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: dataset error
parent
483536a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
datasets_document.py
api/controllers/console/datasets/datasets_document.py
+4
-4
dataset_service.py
api/services/dataset_service.py
+2
-2
list.tsx
web/app/components/datasets/documents/list.tsx
+1
-1
No files found.
api/controllers/console/datasets/datasets_document.py
View file @
a1b48f49
...
@@ -896,13 +896,13 @@ class DocumentRetryApi(DocumentResource):
...
@@ -896,13 +896,13 @@ class DocumentRetryApi(DocumentResource):
location
=
'json'
)
location
=
'json'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
dataset_id
=
str
(
dataset_id
)
dataset_id
=
str
(
dataset_id
)
dataset
=
DatasetService
.
get_dataset
(
dataset_id
)
if
not
dataset
:
raise
NotFound
(
'Dataset not found.'
)
for
document_id
in
args
[
'document_ids'
]:
for
document_id
in
args
[
'document_ids'
]:
try
:
try
:
document_id
=
str
(
document_id
)
document_id
=
str
(
document_id
)
dataset
=
DatasetService
.
get_dataset
(
dataset_id
)
if
not
dataset
:
raise
NotFound
(
'Dataset not found.'
)
document
=
DocumentService
.
get_document
(
dataset
.
id
,
document_id
)
document
=
DocumentService
.
get_document
(
dataset
.
id
,
document_id
)
# 404 if document not found
# 404 if document not found
...
...
api/services/dataset_service.py
View file @
a1b48f49
...
@@ -411,7 +411,7 @@ class DocumentService:
...
@@ -411,7 +411,7 @@ class DocumentService:
def
get_error_documents_by_dataset_id
(
dataset_id
:
str
)
->
list
[
Document
]:
def
get_error_documents_by_dataset_id
(
dataset_id
:
str
)
->
list
[
Document
]:
documents
=
db
.
session
.
query
(
Document
)
.
filter
(
documents
=
db
.
session
.
query
(
Document
)
.
filter
(
Document
.
dataset_id
==
dataset_id
,
Document
.
dataset_id
==
dataset_id
,
Document
.
indexing_status
==
'error'
or
Document
.
indexing_status
==
'paused'
Document
.
indexing_status
==
'error'
or
Document
.
indexing_status
==
'paused'
or
Document
.
indexing_status
==
'waiting'
)
.
all
()
)
.
all
()
return
documents
return
documents
...
@@ -490,7 +490,7 @@ class DocumentService:
...
@@ -490,7 +490,7 @@ class DocumentService:
retry_indexing_cache_key
=
'document_{}_is_retried'
.
format
(
document
.
id
)
retry_indexing_cache_key
=
'document_{}_is_retried'
.
format
(
document
.
id
)
redis_client
.
setex
(
retry_indexing_cache_key
,
600
,
1
)
redis_client
.
setex
(
retry_indexing_cache_key
,
600
,
1
)
# trigger async task
# trigger async task
retry_document_indexing_task
.
delay
(
document
.
dataset_id
,
[
document
.
id
]
)
retry_document_indexing_task
.
delay
(
document
.
dataset_id
,
document
.
id
)
@
staticmethod
@
staticmethod
def
get_documents_position
(
dataset_id
):
def
get_documents_position
(
dataset_id
):
...
...
web/app/components/datasets/documents/list.tsx
View file @
a1b48f49
...
@@ -323,7 +323,7 @@ const DocumentList: FC<IDocumentListProps> = ({ embeddingAvailable, documents =
...
@@ -323,7 +323,7 @@ const DocumentList: FC<IDocumentListProps> = ({ embeddingAvailable, documents =
<
td
className=
'w-12'
>
#
</
td
>
<
td
className=
'w-12'
>
#
</
td
>
<
td
>
{
t
(
'datasetDocuments.list.table.header.fileName'
)
}
</
td
>
<
td
>
{
t
(
'datasetDocuments.list.table.header.fileName'
)
}
</
td
>
<
td
className=
'w-24'
>
{
t
(
'datasetDocuments.list.table.header.words'
)
}
</
td
>
<
td
className=
'w-24'
>
{
t
(
'datasetDocuments.list.table.header.words'
)
}
</
td
>
<
td
className=
'w-
2
4'
>
{
t
(
'datasetDocuments.list.table.header.hitCount'
)
}
</
td
>
<
td
className=
'w-
4
4'
>
{
t
(
'datasetDocuments.list.table.header.hitCount'
)
}
</
td
>
<
td
className=
'w-44'
>
<
td
className=
'w-44'
>
<
div
className=
'flex justify-between items-center'
>
<
div
className=
'flex justify-between items-center'
>
{
t
(
'datasetDocuments.list.table.header.uploadTime'
)
}
{
t
(
'datasetDocuments.list.table.header.uploadTime'
)
}
...
...
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