Commit f30462e2 authored by John Wang's avatar John Wang

feat: add apply option

parent cf4b7667
...@@ -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, 3600, 1) redis_client.setex(cache_key, 86400, 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment