forked from LBRYCommunity/lbry-sdk
dht_crawler: enable WAL
This commit is contained in:
parent
abf4d888af
commit
137d8ca4ac
1 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,13 @@ from sqlalchemy.orm import declarative_base, relationship
|
||||||
import sqlalchemy as sqla
|
import sqlalchemy as sqla
|
||||||
|
|
||||||
|
|
||||||
|
@sqla.event.listens_for(sqla.engine.Engine, "connect")
|
||||||
|
def set_sqlite_pragma(dbapi_connection, _):
|
||||||
|
cursor = dbapi_connection.cursor()
|
||||||
|
cursor.execute("PRAGMA journal_mode=WAL")
|
||||||
|
cursor.close()
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)-4s %(name)s:%(lineno)d: %(message)s")
|
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)-4s %(name)s:%(lineno)d: %(message)s")
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
Base = declarative_base()
|
Base = declarative_base()
|
||||||
|
|
Loading…
Reference in a new issue