Skip to content

Commit 171ada7

Browse files
committed
reg: create copy of dates before resizing due to refcheck error
1 parent 6a25464 commit 171ada7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

dcoraid/dbmodel/meta_cache.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ def __exit__(self, exc_type, exc_val, exc_tb):
116116
def close(self):
117117
for db in self._databases.values():
118118
db.close()
119+
self._databases.clear()
120+
121+
def destroy(self):
122+
self.close()
123+
124+
for path in self.base_dir.glob("circle_*.db"):
125+
path.unlink()
119126

120127
def search(self,
121128
query: str,
@@ -212,7 +219,7 @@ def _upsert_dataset_insert(self, ds_dict):
212219
self._registry_org.setdefault(org_id, []).append(ds_id)
213220

214221
# search array
215-
dates = np.array(self._srt_blobs["created"])
222+
dates = np.array(self._srt_blobs["created"], copy=True)
216223
new_size = dates.size + 1
217224
new_idx = np.searchsorted(dates, m_created)
218225
dates.resize(new_size)

0 commit comments

Comments
 (0)