async fn mark_failed( db: &Arc<RusqliteService>, id: i64, attempts: i32, give_up: bool, reason: &str, ) -> Result<(), String>