File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 99from contextlib import asynccontextmanager
1010import asyncio
1111import logging
12+ import os
1213import re
1314import sqlite3
1415
@@ -148,6 +149,11 @@ async def start(self) -> None:
148149 raise RuntimeError ("database pool can't be restarted" )
149150 self .log .debug (f"Connecting to { self .url } " )
150151 self .log .debug (f"Database connection init commands: { self ._init_commands } " )
152+ if os .path .exists (self ._path ):
153+ if not os .access (self ._path , os .W_OK ):
154+ self .log .warning ("Database file doesn't seem writable" )
155+ elif not os .access (os .path .dirname (os .path .abspath (self ._path )), os .W_OK ):
156+ self .log .warning ("Database file doesn't exist and directory doesn't seem writable" )
151157 for _ in range (self ._pool .maxsize ):
152158 conn = await TxnConnection (self ._path , ** self ._db_args )
153159 if self ._init_commands :
You can’t perform that action at this time.
0 commit comments