Skip to content

Commit a0783b5

Browse files
committed
register gallery close writer thread on shutdown
1 parent a0dbd86 commit a0783b5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

llms/extensions/gallery/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def get_gallery_db():
1919
try:
2020
db_path = os.path.join(ctx.get_user_path(), "gallery", "gallery.sqlite")
2121
g_db = GalleryDB(ctx, db_path)
22+
ctx.register_shutdown_handler(g_db.db.close)
2223
except Exception as e:
2324
ctx.err("Failed to init GalleryDB", e)
2425
return g_db

0 commit comments

Comments
 (0)