Skip to content

Commit ef80dc3

Browse files
committed
close db
1 parent 19e743d commit ef80dc3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pythainlp/corpus/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ def corpus_db_path() -> str:
4444
def get_corpus_db_detail(name: str) -> dict:
4545
db = TinyDB(corpus_db_path())
4646
query = Query()
47-
4847
res = db.search(query.name == name)
48+
db.close()
49+
4950
if res:
5051
return res[0]
5152
else:
@@ -281,6 +282,7 @@ def remove(name: str) -> bool:
281282
db = TinyDB(corpus_db_path())
282283
query = Query()
283284
data = db.search(query.name == name)
285+
db.close()
284286

285287
if data:
286288
path = get_corpus_path(name)

0 commit comments

Comments
 (0)