Skip to content

Commit

Permalink
fix: serialization errors (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 authored Mar 13, 2024
1 parent e27183b commit 40bdb01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/model/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,11 @@ pub async fn upsert_subscription_watcher(
let start = Instant::now();
let mut txn = postgres.begin().await?;
// https://stackoverflow.com/a/48730873
sqlx::query::<Postgres>("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE") // TODO serialization errors not handled
.execute(&mut *txn)
.await?;
// Allow phantom reads; going above the watcher limit is not a big deal and handling
// serialization errors is not worth the effort
// sqlx::query::<Postgres>("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE")
// .execute(&mut *txn)
// .await?;
let result = sqlx::query_as::<Postgres, ()>(query)
.bind(account.as_ref())
.bind(project)
Expand Down

0 comments on commit 40bdb01

Please sign in to comment.