Compare commits
2 Commits
bcc57ac804
...
35d579819c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35d579819c | ||
|
271823e278
|
18
CHANGELOG.md
18
CHANGELOG.md
@@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.2.0] - 2025-09-25
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- reset after failure
|
||||||
|
- print as well
|
||||||
|
- add publish
|
||||||
|
- add features for nats and postgres
|
||||||
|
- add postgres
|
||||||
|
- extract backend
|
||||||
|
- do publish
|
||||||
|
- allow readme
|
||||||
|
|
||||||
|
### Other
|
||||||
|
- *(release)* v0.1.3 (#3)
|
||||||
|
chore(release): 0.1.3
|
||||||
|
- Configure Renovate (#4)
|
||||||
|
Add renovate.json
|
||||||
|
|
||||||
## [0.1.3] - 2025-09-24
|
## [0.1.3] - 2025-09-24
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ members = ["crates/*"]
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.3"
|
version = "0.2.0"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
|||||||
@@ -144,7 +144,10 @@ impl BackendEdge for PostgresBackend {
|
|||||||
|
|
||||||
let res = match res {
|
let res = match res {
|
||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
Err(e) => match &e {
|
Err(e) => {
|
||||||
|
self.revision.store(0, Ordering::Relaxed);
|
||||||
|
|
||||||
|
match &e {
|
||||||
sqlx::Error::Database(database_error) => {
|
sqlx::Error::Database(database_error) => {
|
||||||
if database_error.is_unique_violation() {
|
if database_error.is_unique_violation() {
|
||||||
anyhow::bail!("update conflict: another leader holds lock")
|
anyhow::bail!("update conflict: another leader holds lock")
|
||||||
@@ -155,7 +158,8 @@ impl BackendEdge for PostgresBackend {
|
|||||||
_ => {
|
_ => {
|
||||||
anyhow::bail!(e);
|
anyhow::bail!(e);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
match res {
|
match res {
|
||||||
@@ -170,6 +174,8 @@ impl BackendEdge for PostgresBackend {
|
|||||||
// Only update our local revision if the update succeeded with our expected value
|
// Only update our local revision if the update succeeded with our expected value
|
||||||
self.revision.store(rec.revision as u64, Ordering::Relaxed);
|
self.revision.store(rec.revision as u64, Ordering::Relaxed);
|
||||||
} else {
|
} else {
|
||||||
|
self.revision.store(0, Ordering::Relaxed);
|
||||||
|
|
||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
"update conflict: expected value={}, revision={}, got value={}, revision={}",
|
"update conflict: expected value={}, revision={}, got value={}, revision={}",
|
||||||
val.0.to_string(),
|
val.0.to_string(),
|
||||||
@@ -207,6 +213,8 @@ impl BackendEdge for PostgresBackend {
|
|||||||
.await
|
.await
|
||||||
.context("failed to release lock, it will expire naturally")?;
|
.context("failed to release lock, it will expire naturally")?;
|
||||||
|
|
||||||
|
self.revision.store(0, Ordering::Relaxed);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user