fix: idx cache inconsistency (#2231)

This commit is contained in:
Ellie Huxtable
2024-07-03 08:10:12 +01:00
committed by GitHub
parent c3723aaf27
commit 5fe8ae05e5
2 changed files with 11 additions and 10 deletions

View File

@ -571,7 +571,7 @@ impl Database for Postgres {
"insert into store_idx_cache
(user_id, host, tag, idx)
values ($1, $2, $3, $4)
on conflict(user_id, host, tag) do update set idx = $4
on conflict(user_id, host, tag) do update set idx = greatest(idx, $4)
",
)
.bind(user.id)