File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,6 @@ def _connect(self, db_file: str) -> Connection:
111111
112112 async def __aenter__ (self ) -> "t.Self" :
113113 self ._conn = await self ._conn
114- await self ._conn .execute ("PRAGMA journal_mode=WAL" )
115114 await self ._conn .execute ("PRAGMA busy_timeout=5000" )
116115 return self
117116
@@ -127,6 +126,8 @@ def init_db(cls, db_file: str) -> None:
127126 detect_types = sqlite3 .PARSE_DECLTYPES | sqlite3 .PARSE_COLNAMES ,
128127 timeout = 30.0 ,
129128 ) as conn :
129+ conn .execute ("PRAGMA journal_mode=WAL" )
130+ conn .execute ("PRAGMA busy_timeout=5000" )
130131 conn .execute (
131132 textwrap .dedent ("""\
132133 CREATE TABLE IF NOT EXISTS result (
@@ -199,7 +200,7 @@ async def get_status(self, task_id: str) -> ResultRow:
199200
200201 async def set_status (self , task_id : str , status : ResultStatus ) -> None :
201202 await self ._conn .execute (
202- "UPDATE result SET status = ?, updated_at = ? WHERE task_id = ? AND status = ?" ,
203+ "UPDATE result SET status = ?, executed_at = ? WHERE task_id = ? AND status = ?" ,
203204 (
204205 status .value ,
205206 datetime .datetime .now (tz = datetime .timezone .utc ),
You can’t perform that action at this time.
0 commit comments