MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / update_task

Method update_task

src/core/database.py:1181–1199  ·  view source on GitHub ↗

Update task

(self, task_id: str, **kwargs)

Source from the content-addressed store, hash-verified

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):

Callers 2

_fail_video_taskMethod · 0.80
_poll_video_resultMethod · 0.80

Calls 1

_connectMethod · 0.95

Tested by

no test coverage detected