Button working now

This commit is contained in:
Alex
2023-03-20 14:34:51 +00:00
parent e7bd9b6323
commit 3e98f9e6bd
2 changed files with 19 additions and 9 deletions

View File

@@ -410,8 +410,11 @@ def delete_old():
if dirs[0] not in ['indexes', 'vectors']:
return {"status": 'error'}
path_clean = '/'.join(dirs)
shutil.rmtree(path)
vectors_collection.delete_one({'location': path})
try:
shutil.rmtree(path_clean)
except FileNotFoundError:
pass
return {"status": 'ok'}
# handling CORS