Update task
(self, task_id: str, **kwargs)
| 1179 | return None |
| 1180 | |
| 1181 | async def update_task(self, task_id: str, **kwargs): |
| 1182 | """Update task""" |
| 1183 | async with self._connect(write=True) as db: |
| 1184 | updates = [] |
| 1185 | params = [] |
| 1186 | |
| 1187 | for key, value in kwargs.items(): |
| 1188 | if value is not None: |
| 1189 | # Convert list to JSON string for result_urls |
| 1190 | if key == "result_urls" and isinstance(value, list): |
| 1191 | value = json.dumps(value) |
| 1192 | updates.append(f"{key} = ?") |
| 1193 | params.append(value) |
| 1194 | |
| 1195 | if updates: |
| 1196 | params.append(task_id) |
| 1197 | query = f"UPDATE tasks SET {', '.join(updates)} WHERE task_id = ?" |
| 1198 | await db.execute(query, params) |
| 1199 | await db.commit() |
| 1200 | |
| 1201 | # Token stats operations (kept for compatibility, now delegates to specific methods) |
| 1202 | async def increment_token_stats(self, token_id: int, stat_type: str): |
no test coverage detected