Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 68c803a

Browse files
committed
fix from rebase
1 parent 9e8530f commit 68c803a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/import_packages.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import asyncio
2+
from datetime import date
23
import json
4+
import os
35

46

57
import weaviate
@@ -15,7 +17,8 @@ class PackageImporter:
1517
def __init__(self):
1618
self.client = weaviate.WeaviateClient(
1719
embedded_options=EmbeddedOptions(
18-
persistence_data_path="./weaviate_data", grpc_port=50052
20+
persistence_data_path="./weaviate_data", grpc_port=50052,
21+
additional_env_vars={"ENABLE_MODULES": "backup-filesystem", "BACKUP_FILESYSTEM_PATH": os.getenv("BACKUP_FILESYSTEM_PATH", "/tmp")}
1922
)
2023
)
2124
self.json_files = [
@@ -85,7 +88,10 @@ async def add_data(self):
8588

8689
async def run_import(self):
8790
self.setup_schema()
88-
#await self.add_data()
91+
# await self.add_data()
92+
93+
#  take a backup of the data
94+
await self.client.backup.create(backup_id="backup-"+date.today().strftime("%Y-%m-%d"), backend="filesystem", wait_for_completion=True)
8995

9096

9197
if __name__ == "__main__":

0 commit comments

Comments
 (0)