MCPcopy Create free account
hub / github.com/AS-AIGC/TranscriptHub / cancel_task

Function cancel_task

apps/backend/services/task_service.js:186–199  ·  view source on GitHub ↗

* @brief Cancel a transcription task by ID * * @param data [in] Task cancellation parameters: * - objid [BigInt] Task identifier to cancel * * @return SQL result object containing: * - rowsAffected: Number of tasks cancelled * - recordset: Updated task record * * @throws Error if canc

(data)

Source from the content-addressed store, hash-verified

184 * @note Only cancels tasks that aren't completed
185 */
186async function cancel_task(data) {
187 const query_cancel_task = TASK_QUERIES.CANCEL_TASK;
188 try {
189 const pool = await pool_promise;
190 const result = await pool.request()
191 .input('objid', sql.BigInt, data.objid)
192 .query(query_cancel_task);
193
194 return result
195 } catch (err) {
196 logger(LOG_LEVEL.ERROR, `cancel_task ${err}.`);
197 throw err;
198 }
199}
200
201/**
202 * @brief Clean up abandoned or stale tasks in the system

Callers 1

cancel_task_controllerFunction · 0.85

Calls 1

loggerFunction · 0.85

Tested by

no test coverage detected