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
f30462e2
Commit
f30462e2
authored
May 25, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add apply option
parent
cf4b7667
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
commands.py
api/commands.py
+3
-2
No files found.
api/commands.py
View file @
f30462e2
...
@@ -159,7 +159,8 @@ def generate_recommended_apps():
...
@@ -159,7 +159,8 @@ def generate_recommended_apps():
@
click
.
command
(
'sync-index'
,
help
=
'Sync vector objects to another vector store'
)
@
click
.
command
(
'sync-index'
,
help
=
'Sync vector objects to another vector store'
)
def
sync_index_vector_objects
():
@
click
.
option
(
'--apply'
,
help
=
'Apply to dataset index struct.'
)
def
sync_index_vector_objects
(
apply
):
print
(
'Syncing vector objects...'
)
print
(
'Syncing vector objects...'
)
datasets
=
db
.
session
.
query
(
Dataset
)
.
order_by
(
Dataset
.
created_at
.
asc
())
.
limit
(
100
)
.
all
()
datasets
=
db
.
session
.
query
(
Dataset
)
.
order_by
(
Dataset
.
created_at
.
asc
())
.
limit
(
100
)
.
all
()
while
len
(
datasets
)
>
0
:
while
len
(
datasets
)
>
0
:
...
@@ -220,7 +221,7 @@ def sync_index_vector_objects():
...
@@ -220,7 +221,7 @@ def sync_index_vector_objects():
duplicate_check
=
True
duplicate_check
=
True
)
)
redis_client
.
setex
(
cache_key
,
36
00
,
1
)
redis_client
.
setex
(
cache_key
,
864
00
,
1
)
except
Exception
:
except
Exception
:
logging
.
exception
(
'failed to add nodes to vector index'
)
logging
.
exception
(
'failed to add nodes to vector index'
)
continue
continue
...
...
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