Skip to content

Commit

Permalink
bump client version, try another way to ensure db is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
YevheniiSemendiak committed Feb 14, 2023
1 parent 374b569 commit 418406b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion neuro-sdk/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ install_requires =
packaging>=20.4
neuro-admin-client>=22.7.2
# fixed to unblock while we releasing client
neuro-config-client @ git+https://github.com/neuro-inc/neuro-config-client.git@cbb2dae
neuro-config-client>=23.2.3

[options.packages.find]
where=src
Expand Down
14 changes: 7 additions & 7 deletions neuro-sdk/src/neuro_sdk/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,17 @@ def _open_db_ro(
f"run 'chmod 600 {config_file}' first"
)

with sqlite3.connect(str(config_file)) as db:
conn = sqlite3.connect(str(config_file))
try:
# forbid access for other users
os.chmod(config_file, 0o600)

if not skip_schema_check:
_check_db(db)
db.row_factory = sqlite3.Row
try:
yield db
finally:
db.close()
_check_db(conn)
conn.row_factory = sqlite3.Row
yield conn
finally:
conn.close()


def _load(path: Path) -> _ConfigData:
Expand Down

0 comments on commit 418406b

Please sign in to comment.