Mercurial > code > home > repos > sco-bot
comparison scobot/index/access.py @ 15:6ed25bcaaf1f
add prefect and rebuild flow to k8s
author | drewp@bigasterisk.com |
---|---|
date | Fri, 19 Jul 2024 00:30:47 -0700 |
parents | 403eff4a16c8 |
children | 7a87ba2f00d9 |
comparison
equal
deleted
inserted
replaced
14:b9c2b7fedbcd | 15:6ed25bcaaf1f |
---|---|
10 | 10 |
11 class SearchIndex: | 11 class SearchIndex: |
12 | 12 |
13 def __init__(self, indexDir: Path, delete_existing=True): | 13 def __init__(self, indexDir: Path, delete_existing=True): |
14 if delete_existing: | 14 if delete_existing: |
15 shutil.rmtree(indexDir) | 15 shutil.rmtree(indexDir, ignore_errors=True) |
16 indexDir.mkdir(parents=True, exist_ok=True) | 16 indexDir.mkdir(parents=True, exist_ok=True) |
17 self.ix = create_in(indexDir, schema) | 17 self.ix = create_in(indexDir, schema) |
18 else: | 18 else: |
19 self.ix = open_dir(indexDir) | 19 self.ix = open_dir(indexDir) |
20 self.writer = self.ix.writer() | 20 self.writer = self.ix.writer() |