From ecc2955d70d75dca8bbb878a3a1fbd8e9b6e1109 Mon Sep 17 00:00:00 2001 From: Sam Andreae Date: Wed, 26 Jul 2023 09:47:09 +0100 Subject: [PATCH] Don't check affected rows when deleting task (#461) * Don't check affected rows when deleting task * Update CHANGELOG --------- Co-authored-by: Andreas Dzialocha --- CHANGELOG.md | 1 + aquadoggo/src/db/stores/task.rs | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46eea9fae..0f249fd78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix race condition when check for existing view ids was too early [#420](https://github.com/p2panda/aquadoggo/pull/420) - Use fork of `asynchronous-codec` to temporarily fix CBOR decoding bug [#440](https://github.com/p2panda/aquadoggo/pull/440) - Fix composing of circuit relay address [#451](https://github.com/p2panda/aquadoggo/pull/451) +- Don't check for `affected_rows` on task deletion [#461](https://github.com/p2panda/aquadoggo/pull/461) - Do not critically fail when view does not exist due to race condition [#460](https://github.com/p2panda/aquadoggo/pull/460) ### Open Sauce diff --git a/aquadoggo/src/db/stores/task.rs b/aquadoggo/src/db/stores/task.rs index d0e7b3054..17f1d85da 100644 --- a/aquadoggo/src/db/stores/task.rs +++ b/aquadoggo/src/db/stores/task.rs @@ -66,7 +66,7 @@ impl SqlStore { }; // Remove task from database - let result = query( + query( " DELETE FROM tasks @@ -85,11 +85,7 @@ impl SqlStore { .await .map_err(|err| SqlStoreError::Transaction(err.to_string()))?; - if result.rows_affected() != 1 { - Err(SqlStoreError::Deletion("tasks".into())) - } else { - Ok(()) - } + Ok(()) } /// Returns "pending" tasks of the materialization service worker.