Mercurial > libervia-backend
comparison sat/memory/sqla_config.py @ 3814:4edfd7521418
core (memory/sqla_config): set a timeout for SQLite:
with default timeout, we may have database lock errors from time to time. To avoid this, a
timeout of 30s is now set.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 29 Jun 2022 10:17:33 +0200 |
parents | 71516731d0aa |
children | 524856bd7b19 |
comparison
equal
deleted
inserted
replaced
3813:1a10b8b4f169 | 3814:4edfd7521418 |
---|---|
30 - path: path to the sqlite DB | 30 - path: path to the sqlite DB |
31 """ | 31 """ |
32 main_conf = config.parseMainConf() | 32 main_conf = config.parseMainConf() |
33 local_dir = Path(config.getConfig(main_conf, "", "local_dir")) | 33 local_dir = Path(config.getConfig(main_conf, "", "local_dir")) |
34 database_path = (local_dir / C.SAVEFILE_DATABASE).expanduser() | 34 database_path = (local_dir / C.SAVEFILE_DATABASE).expanduser() |
35 url = f"sqlite+aiosqlite:///{quote(str(database_path))}" | 35 url = f"sqlite+aiosqlite:///{quote(str(database_path))}?timeout=30" |
36 return { | 36 return { |
37 "type": "sqlite", | 37 "type": "sqlite", |
38 "path": database_path, | 38 "path": database_path, |
39 "url": url, | 39 "url": url, |
40 } | 40 } |