mirror of
https://github.com/Diggsey/sqlxmq.git
synced 2024-11-28 03:01:06 +00:00
Retry on foreign key violation
This commit is contained in:
parent
08b71b59ae
commit
9424605cfb
3 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sqlxmq"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
authors = ["Diggory Blake <diggsey@googlemail.com>"]
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
@ -23,7 +23,7 @@ uuid = { version = "0.8.2", features = ["v4"] }
|
|||
log = "0.4.14"
|
||||
serde_json = "1.0.64"
|
||||
serde = "1.0.124"
|
||||
sqlxmq_macros = { version = "0.3.0", path = "sqlxmq_macros" }
|
||||
sqlxmq_macros = { version = "0.3.1", path = "sqlxmq_macros" }
|
||||
anymap2 = "0.13.0"
|
||||
|
||||
[features]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "sqlxmq_macros"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
authors = ["Diggory Blake <diggsey@googlemail.com>"]
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
|
|
@ -243,6 +243,8 @@ pub fn should_retry(error: &sqlx::Error) -> bool {
|
|||
// It's more readable as a match
|
||||
#[allow(clippy::match_like_matches_macro)]
|
||||
match (db_error.code().as_deref(), db_error.constraint().as_deref()) {
|
||||
// Foreign key constraint violation on ordered channel
|
||||
(Some("23503"), Some("mq_msgs_after_message_id_fkey")) => true,
|
||||
// Unique constraint violation on ordered channel
|
||||
(Some("23505"), Some("mq_msgs_channel_name_channel_args_after_message_id_idx")) => true,
|
||||
// Serialization failure
|
||||
|
|
Loading…
Reference in a new issue