MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / delete_task

Method delete_task

src/context/task_storage.rs:370–386  ·  view source on GitHub ↗
(
        &self,
        id: &str,
    )

Source from the content-addressed store, hash-verified

368 }
369
370 pub async fn delete_task(
371 &self,
372 id: &str,
373 ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
374 let conn = Arc::clone(&self.conn);
375 let id = id.to_string();
376 tokio::task::spawn_blocking(move || {
377 let conn = conn.lock().map_err(|e| format!("Lock error: {e}"))?;
378 let rows_affected =
379 conn.execute("DELETE FROM tasks WHERE id = ?1", rusqlite::params![id])?;
380 if rows_affected == 0 {
381 return Err("Task not found".into());
382 }
383 Ok(())
384 })
385 .await?
386 }
387
388 /// Transition a task to Running status, setting `started_at` to now.
389 pub async fn mark_running(

Callers 2

executeMethod · 0.45
test_crud_operationsFunction · 0.45

Calls 1

executeMethod · 0.45

Tested by 1

test_crud_operationsFunction · 0.36